noahd1 / oink

Log parser to identify actions which significantly increase VM heap size
MIT License
1.18k stars 71 forks source link

shouldn't virtual size (vsz) be monitored rather than resident set (rss)? also on linux you can get that from /proc #1

Closed ColinDKelley closed 14 years ago

ColinDKelley commented 14 years ago

I noticed that the monitoring is looking at resident set rss. On a memory-starved machine that will be lower than the real bloat since you're constrained on physical memory. Virtual size (vsz) would be more accurate wouldn't it?

Also I noticed that the data is gathered by running ps. On linux machines there is a /proc directory which can be read, avoiding a whole fork/exec. I have that working using the equivalent of vsz.

I can contribute a patch with both these changes if there's interest.

ghazel commented 14 years ago

The proc reading is of interest to me. The ps fork/exec method is a significant performance hit.

noahd1 commented 14 years ago

Colin -

These both sound valuable. If you submit a patch I will merge them in. Thanks -

Noah

ColinDKelley commented 14 years ago

Great, I'll put a patch together with tests, within a week or so.

ColinDKelley commented 14 years ago

Noah,

I've sent you the patch. For the rspec test I required mocha. Hope that's ok.

-Colin

noahd1 commented 14 years ago

Thanks Colin - I'll take a look this weekend when I have a bit more free time.

noahd1 commented 14 years ago

I just merged in your change. I removed the mocha dependency just because I'm more familiar with rspec's mocking/stubbing. Thanks for your contribution -- especially for providing tests.