[Gtk-sharp-list] Lot of Memory in Gtk Gui?

Bruno Fernandez-Ruiz brunofr@olympum.com
Mon, 13 Oct 2003 07:56:11 +0300

On Sun, 2003-10-12 at 23:28, Pablo Fischer wrote:
> Like you can see Im using 5MB for my app but im using a very simple GUI,
> what Im using?
> ...
> So, any ideas to dont use 9MB just for a simple Blogger Editor?

For client-side software like your blog application, I think you need to
live with the fact that 5Mb is the price you pay for automatic memory
management. In virtual machines, you don't have the same control over
the heap as you do when you manage the memory yourself. The VM allocates
an initial heap, which is used by your object allocations. The GC thread
cleans up unreferenced memory, and makes it available to new
allocations. The memory displayed by free or ps is not the actual
allocated part of the heap, but the heap reclaimed to the OS by the VM.

(Most) Java VMs allow you to declare minimum heap and maximum heap with
non-standard command line flags (e.g. -Xms and -Xmx). The JVM starts
with a heap equal to the minimum heap (e.g. 8Mb). If after a GC mark
cycle the VM cannot allocate the requested memory within the current
heap, the JVM will expand the heap. If the current heap overflows the
max heap (e.g. 64Mb), you get an out of memory error. Min/Max heap
settings are extremely important in server-side software, to be able to
expand and contract the heap as the load changes without bringing down
the server. 

Does Mono have this type of heap control / GC settings??


> Thanks!
> Pablo
Bruno Fernandez-Ruiz <brunofr@olympum.com>
The Olympum Group,  http://www.olympum.com