[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2020.0. "Widget's memory allocation." by TAVHLT::DORON (Doing my BEST !!!) Wed Jan 10 1990 05:21

Hi,

 a client of my is writing an application with hunders of widgets. Beacuase of
memory consupmtion considerations he want to know the average amount of memory
that a widget will capture. (e.g. dialog box with 10 childern). Is there a way
to calculate it? Is it allowed to give such information to a client?

				Thanks,
					*-Doron-*
T.RTitleUserPersonal
Name
DateLines
2020.1Of course, they're using gadgets wherever they can...GOSOX::RYANDECwindows MailWed Jan 10 1990 08:386
	It's easily done (for client-side memory consumption, at least) -
	just write a program that #include's DECW$INCLUDE:DWTWIDGET.H
	and takes the sizeof of widget records (for example, for the
	label widget do a sizeof(LabelRec)).

	Mike
2020.2Really takes much moreDECWIN::KLEINWed Jan 10 1990 14:0522
>>	It's easily done (for client-side memory consumption, at least) -
>>	just write a program that #include's DECW$INCLUDE:DWTWIDGET.H
>>	and takes the sizeof of widget records (for example, for the
>>	label widget do a sizeof(LabelRec)).

Not even close.  You need to account for compiled translation tables,
callback lists, strings and compound strings, etc, etc.  Some widgets
may need two or three times (or much more) as much VM for these things
than their simple widget record requires.

Better to actually do it.  Write a tiny program that loads a big UIL
hierarchy, watch the process's virtual page count, and plot some points.
Probably linear, but with a sizeable non-zero starting point.
Different widgets behave differently.

Better to ask why they need 100s of widgets.  Why not gadgets (which
have quite different memory requirements) or maybe a custom widget
or two if they're handling large lists or something like that.  You
could conceivably cut down memory usage and improve performance by
orders of magnitude by looking at the problem a different way.

-steve-