Re: memory allocations.

Havoc Pennington wrote:
iain <iain ximian com> writes:
I'm not sure where this could go, possibly in g_thread_init add a call
to g_mem_set_vtable which switches to the faster malloc?


That would make malloc unthreadsafe as soon as you turned on
threading. ;-) Maybe not a great idea...

However, looking at the amount of mallocs happening duing the startup of even the simplest gnome2 app, does indicate this could be a big optimisation.

For example, a few malloc counts, for just starting up an app, measured with memprof:

yelp: 55000 (!)
nautilus: 42000
gnome-calculator: 17000
gedit: 19000 (plus 7 a second when the window is active (?))
gnome-dict: 17000
gfloppy: 15000
gnome-search-tool: 19000
gnome-system-monitor: 22000

(!!) gnome-system-monitor, in process view, generates 2500 mallocs per second (!!), this is kinda silly and asking for large memory fragmentation?

btw, by comparisment, starting up gdict (gnome1 version) generates 6000 mallocs. this is less then 50% of the malloc count for its gnome2 version.

	-- Chris

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]