[Top][All Lists]

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

Re: Emacs 23 Mac port

From: YAMAMOTO Mitsuharu
Subject: Re: Emacs 23 Mac port
Date: Tue, 17 Jan 2012 19:51:12 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shij┼Ź) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Tue, 17 Jan 2012 12:47:38 +0900, YAMAMOTO Mitsuharu <address@hidden> 
>>>>> said:

>> This version seems to have the same memory problem (not returning
>> memory to the OS) as the regular gnu emacs on OS X.  Aquamacs seems
>> not to have this issue...(?)

> My guess is that Aquamacs is in 32-bit and the others are in 64-bit.

I browsed the source code of the malloc library on Mac OS X 10.7.2,
and found that actually this difference of 32-bit vs. 64-bit affects
the behavior of caching.

For machines equipped with >= 1GB RAM, allocation for size >= 128kB is
handled by the "large" version of malloc/free etc.  And some large
allocations are cached by the malloc library.  For 64-bit executables,
up to 16 cache entries and each entry is up to 128MB.  For 32-bit
executables, up to 8 cache entries and each entry is up to 4MB.  For
both cases, the total cache size is up to 0.1% of RAM.

So if you kill 3 buffers each of which occupies 5MB in size on a 16GB
RAM machine, then 15MB memory is kept as cache by the malloc library
for the 64-bit case even after garbage collection, while it is
returned to the system for the 32-bit case.

                                     YAMAMOTO Mitsuharu

reply via email to

[Prev in Thread] Current Thread [Next in Thread]