[TxMt] Is TM memory hog? 10MB text file makes TM use 564MB of RAM

Adam Strzelecki ono at java.pl
Tue May 20 11:28:35 UTC 2008

Thanks for the response Allan,

Currently my only concern is the fact that setting such a file to be  
"Plain Text" makes TM eat 564, while setting it to something else...  
makes TM use just 137 MB.
Over 400MB difference just because of source file language/grammar  
looks suspicious for me.

And now regarding the memory reclamation...

> See http://kevin.sb.org/2007/07/05/malloc-free-space-not-reclaimed/#comment-247

Using vmmap when opening large file TM using ~560MB:
> MALLOC_SMALL           19000000-2f000000 [352.0M] rw-/rwx SM=COW   
> DefaultMallocZone_0x400000
> MALLOC_SMALL           2f800000-33000000 [ 56.0M] rw-/rwx SM=COW   
> DefaultMallocZone_0x400000

After a while, closing large file, TM still using 538MB of real memory:
> MALLOC_SMALL (freed)   19000000-2f000000 [352.0M] rw-/rwx SM=PRV   
> DefaultMallocZone_0x400000
> MALLOC_SMALL (freed)   2f800000-32800000 [ 48.0M] rw-/rwx SM=PRV   
> DefaultMallocZone_0x400000

MALLOC_TINY was < 100MB all together.

So it seems tose 400MB that are freed are still kept by the OSX, which  
is IMHO pretty lame behavior. I just wonder it there's any kernel  
function to trigger VM flush/cleanup.

Alternative solution I can see is writing own memory pool that uses  
vm_allocate. Is this feasible Allan?

Adam Strzelecki |: nanoant.com :|

More information about the textmate mailing list