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

Hazelcast can consume large amounts of memory in com.hazelcast.nio.Packet instances. #312

Closed
alexturc opened this issue Oct 19, 2012 · 0 comments

Comments

Projects
None yet
2 participants
@alexturc
Copy link

commented Oct 19, 2012

I have a situation where clients connect to the cluster and they can get large amounts of data part of the initialization procedure. Clients do not connect all at the same time. Once they got initialized, it is possible that nothing will happen for a while. However, there are some residual com.hazelcast.nio.Packet instance objects held in a queue for reuse in com.hazelcast.nio.Connection objects.

So the end result is that I can get many clients connecting to the cluster over a period of time, without putting any stress on the system. But the Connection instance for each client ends up holding string references to these Packet instances which just use memory which will actually never be used again.

Packet objects are reset immediately after they are retrieved from the pool for reuse.

The problem would go away if Packet objects would be reset just before they are returned to the pool. Reseting a packet is not a significant operation, it boils down to settings some fields to some values, I think is very CPU-cache so it would execute very fast.

@mdogan mdogan closed this in 057970f Oct 23, 2012

@ghost ghost assigned mdogan Oct 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.