Rising RSS and no JS heap growth is exactly the symptoms I was seeing that caused me to expose mtrace in a node module, but my conclusion is that it's a hard thing to track down, especially in C++ app. Sadly it seems Buffers show up as just "operator new()" in an mtrace, so if those are leaking, you won't know much for sure, as it'll just be reported in the one big "new" bucket, though looking at the sizes of outstanding allocations (using the GCC mtrace command line tool) you might be able to deduce something useful.
I also had some luck just taking a core dump with gcore and looking at the dump in a hex editor (in my case, the data was clearly big blocks of triplets of 32 bit floats and then big blocks of integers, so I could conclude it was vertex and index buffers, and combined with the mtrace results I knew to look for places that were calling new on these kinds of objects and might not be deleting them - in your case perhaps you'll get lucky and see some repeating data that might indicate what kind of data is leaking). It's useful to note that any Buffers under 8kb in size end up coming out of pooled 8kb buffers, and as long as any JS object is referencing any slice of that buffer, the whole 8kb is still going to be in memory, which can be misleading (or the cause of "leaks" if you're, say, slicing out a few bytes of the buffer and hanging on to them for some reason). - Jimb On Mar 19, 9:52 am, Nico Kaiser <[email protected]> wrote: > Thanks Ilya, I'll have a second look at node-mtrace. > > I tried this (as I did read the list ;-)), but it did not help much, and I > hoped someone could identify a specific class of problems with my > description (RSS grows, heap stays ok)... > > Nico > > Am Montag, 19. März 2012 16:06:38 UTC+1 schrieb Ilya Dmitrichenko: > > > > > > > > > > > On 19 March 2012 14:09, Nico Kaiser <[email protected]> wrote: > > > How can I debug this behavior? I tried node-inspector, but v8-profiler > > only > > > works with Node 0.4. Running node-gc every few seconds smoothes the > > memory > > > curve, but does not help anything. > > > If you did read the list, you would come across the same issue being > > discussed in this post: > >https://groups.google.com/d/msg/nodejs/Aq9BId5Tff8/7G3JxaIVd2YJ > > >https://github.com/Jimbly/node-mtrace > > > > I observed that process.memoryUsage().heapTotal stays at an acceptable > > level > > > (about 150 MB), only rss grows until the process gets killed. Does this > > tell > > > anything, e.g. Buffer leak? (I know the WebSocket modules use lots of > > small > > > buffers, but they should get freed, shouldn't they?). > > > > Do you have any hint where I can look for leaks? > > > > Thanks, > > > Nico > > > > -- > > > Job Board:http://jobs.nodejs.org/ > > > Posting guidelines: > > >https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > > > You received this message because you are subscribed to the Google > > > Groups "nodejs" group. > > > To post to this group, send email to [email protected] > > > To unsubscribe from this group, send email to > > > [email protected] > > > For more options, visit this group at > > >http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
