memory leaks - how to garbage collect a direct buffer java -


I have a memory leak that I have separated the directly byte buffers that were handled incorrectly.

 ByteBuffer buff = ByteBuffer.allocateDirect (7777777) 

GC collects those buffers that monkeys these buffers but does not dispose of buffers themselves if I have buffers Instant transient objects, I get this encouraging message.

 java.lang.OutOfMemoryError: Direct buffer memory 

I am searching for this problem and apparently

 

< P>

 System.gc () 

does not work

I suspect that somewhere in your application is a reference to the byteffor instance (s) and it is preventing garbage from being collected.

Buffer memory for a normal byte buffer is allocated outside the normal pile (so that the GC does not move it !!) However, the Bytebuff API does not provide any way to clear / remove a buffer clearly is. So I think the garbage collector will do this ... Once it determines that the bytebuff object is no longer referred.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -