On Tue, 19 Mar 2002, Daniel Pittman wrote:
On Mon, 18 Mar 2002, Ben Wing wrote:
[...]
What /does/ show up is the reason why the XEmacs image balloons to
80MB or so during startup.
[...]
Once the startup is done and XEmacs is sitting in the *scratch*
buffer
this drops to some 59,236 bytes still allocated.
That should have been 59,236 /kilo/ bytes. :)
So, this is clearly temporary data -- it's just very *big*
temporary
data.
...and on further investigation, this is actually worse than I thought.
I sat through a full startup with Ben-MULE. This means that my code did
a whole bunch of face manipulation, loaded a number of things including
BBDB, CC-mode, did a bit of byte-compiling, then started Gnus.
No garbage collection occurred between the drop described above and the
completion of loading of Gnus -- it seems that .xemacs/init.el is run
with garbage collection disabled.
This is suboptimal, IMO, because it results in a much larger fragmented
image when the init process is done.
Anyway, this startup run had a peak image size of around 485MB, dropping
down to 125MB or so when it did a GC pass after the init file had
finished.
Sadly I can't track down exactly *where* this memory allocation is
coming from. The closest I can get is that it centers around the set of
calls `Ffuncall', `Feval', `execute_optimized_program' and
`funcall_compiled_function'.
Obviously this is the core loop of the Lisp engine. I can't for the life
of me see what, if anything, in there is causing this bloom in memory
usage, though.
Worse still, none of the information that I can extract from the memory
profiler[1] seems to account for it -- it looks like those functions are
(recursively) doing the needed allocation directly, not calling
sub-functions which do it. :(
I can't really test beyond this point at the moment, partly because I
should do some real work and partly because I am out of ideas as to what
more I /can/ do to trace down this problem.
Er, does anyone out there know of a memory allocation tracing tool that
works with Linux and XEmacs? Other, sadly, than Purify, which I have no
license for.
Daniel
Footnotes:
[1] memprof, a Linux-based tool, run against the lined xemacs.
--
The two greatest obstacles to democracy in the United States are, first, the
widespread delusion among the poor that we have a democracy, and second, the
chronic terror among the rich, lest we get it.
-- Edward Dowling