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

Provide the way to determine how much memory used by index #38

Open
GoogleCodeExporter opened this issue Jun 15, 2015 · 2 comments
Open

Comments

@GoogleCodeExporter
Copy link

As I can see here 
https://groups.google.com/forum/#!topic/cqengine-discuss/RX_ESsAKZqQ index can 
take a lot of memory. In provided example up to 40 times the size of the data.
It would be nice to have ability to detect how much memory gone where.
At least approximately.

Original issue reported on code.google.com by g...@inbox.ru on 15 Dec 2014 at 3:12

@GoogleCodeExporter
Copy link
Author

This is an enhancement request, not a defect.

I can see how this would be useful. It's a tricky question though. I have some 
ideas on this, I'll think about how best to proceed.

In the meantime, in general, a helpful way to find which types of objects are 
using most memory is the command line:

jmap -histo:live <pid of jvm>


Original comment by ni...@npgall.com on 15 Dec 2014 at 3:21

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Done in CQEngine 2.0:

The size of the collection can roughly be determined by configuring it to use 
off-heap or disk persistence, and then calling: 
http://cqengine.googlecode.com/svn/cqengine/javadoc/apidocs/com/googlecode/cqeng
ine/persistence/Persistence.html#getBytesUsed()

The size of off-heap or disk indexes can roughly be determined in a similar 
way: determine the size of the collection as above, add the index, then 
determine bytes used again, and subtract.

Also, for most indexes including on-heap indexes, the number of buckets and the 
number of objects in each bucket can be determined via the following API which 
most indexes now implement: 
http://cqengine.googlecode.com/svn/cqengine/javadoc/apidocs/com/googlecode/cqeng
ine/index/support/KeyStatisticsIndex.html

Original comment by ni...@npgall.com on 20 Apr 2015 at 8:32

  • Changed state: Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant