noahd1 / oink

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

speedup via /proc/self/statm #3

Closed jordan-brough closed 13 years ago

jordan-brough commented 13 years ago

Hey all, here's an oink tweak (that has an interesting ring to it...) providing a non-trivial speed increase. Let me know if you're interested. If you want any tweaks just let me know and I'll be happy to oblige.

Also related: d58e14ccac9a2795d0df2d6e05b355fe89e47c86, though I'm not sure it's worth the extra system call. My *nix-guru co-worker's opinion: "I'd say just document that it assumes 4k page size. It's only different on strange architectures..". Any thoughts?

Thanks.

ColinDKelley commented 13 years ago

I like it. This tutorial endorses statm: http://www.linuxplanet.com/linuxplanet/tutorials/6830/1/ Also I don't see a problem with the system call. It's cached using ||= so it'll only execute once. The only thing I'd like to change is to "rescue 4096" in case the command line fails to run. (That could happen due to path issues or privileges.)

noahd1 commented 13 years ago

Thanks for your contribution. Seems like this is a win. I like Colin's suggestion of a cached system call for page size with an intelligent default. Do you want to add this to your patch? Then I can merge in.

jordan-brough commented 13 years ago

Great, here's a new commit w/ the original patch, the page-size fetching and Colin's suggestion: http://github.com/jordan-brough/oink/commit/b6473f16413528e0a9fea4ed933fef71e628245e

noahd1 commented 13 years ago

Merged and released! Thank you!