Linux 64 bit
Build 3114 (and earlier builds)
Each time that a file is opened in Sublime Text, an additional 8 MB of writable private memory is taken from the OS. When using ST3 extensively, this can cause an explosion in memory.
I have traced this down to a memory leak due to improper pthread termination.
Whatever thread starts at location 0x4bc7b1 (it runs each time you open a new file) that runs for only a small amount of time gets allocated an 8MB stack. Unfortunately, without calling pthread_detach and/or pthread_exit, it appears that the stack memory is not freed up.
“Fix” method:
-LD_PRELOAD a library
-Override pthread_create
-call pthread_detach if the start_routine is 0x4bc7b1
-insert a different start routine which calls 0x4bc7b1 if applicable. end the start routine with a call to pthread_exit
And no more continual 8MB allocation (it can figure out how to reuse that 8MB stack chunk!)
Edit: It appears that one can intercept all start routines, and after calling the original routine, add a pthread_detach(pthread_self()); and pthread_exit(0); No worrying about grabbing the right pthread now!