开发者

Check the size of objects in a Gemfire cache

Does anyone know of a way to check the size of objects stored in a gemfire cache? Or even the size of the regions themselves (in MB, rather than the number of objects they contain).

开发者_开发问答

We're tweaking the makeup of some of our objects and I'd like to see what extra/less strain we're putting on the time it takes for Gemfire to serialize them and the size of the end product...

Cheers, Dave.


In case others tread this path, here are a couple of recently posted articles which may be relevant to this question:

Data Sizer Java Utility Class: http://communities.vmware.com/docs/DOC-20695

Perhaps, not specific enough, but still very useful is GemFire Memory Sizing Guidelines: http://communities.vmware.com/docs/DOC-20714


It's maybe a bit late to answer to your question but you can try one of the following to get the size of your objects in the cache:

1) Use GFMon that you can download from the vmware website. It will tell you the size in bytes of each region.

2) Use the method CachedDeserializableFactory.calcSerializedMemSize(object), it will tell you the size of the object in memory after it has been serialized.

You need to be aware that your objects will not always be stored in serialized form in the cache. To force the objects to be serialized in the cache, you can use the system property gemfire.PREFER_SERIALIZED=true.

For example: java -Dgemfire.PREFER_SERIALIZED=true com.example.MyCacheServer

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜