Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process.memoryUsage() isn't quite right #116

Closed
gbrail opened this issue May 18, 2015 · 1 comment
Closed

process.memoryUsage() isn't quite right #116

gbrail opened this issue May 18, 2015 · 1 comment
Milestone

Comments

@gbrail
Copy link
Contributor

gbrail commented May 18, 2015

In particular, it does the following (calls from java.lang.Runtime()):

rss: totalMemory()
heapTotal: maxMemory()
heapUsed: totalMemory()

heapUsed ends up being the current size of the heap, regardless of how much is free. It should really be (totalMemory() - freeMemory()).

Given that, should "heapTotal" be "maxMemory" or "totalMemory"? Good question.

Also not sure what to do about "rss". Java doesn't tell us that specifically.

@gbrail gbrail added this to the Trireme 0.8.6 milestone Jun 18, 2015
@gbrail
Copy link
Contributor Author

gbrail commented Jun 18, 2015

Change this so that it will do the following, from java.lang.Runtime:

rss and heapTotal: totalMemory()
heapMax: maxMemory()
heapUsed: totalMemory() - freeMemory()

The result is that you'll be able to actually use heapUsed to see how far you are from the max.

@gbrail gbrail closed this as completed Jun 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant