cdotsip / jain-sip

Automatically exported from code.google.com/p/jain-sip
0 stars 1 forks source link

Ability to control how NIO buffers are resided in the memory #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes NIO Stack gives on 32bit Java 6 under Windows, with Xmx set to 1224M. 

java.lang.OutOfMemoryError 
at sun.misc.Unsafe.allocateMemory(Native Method) 
at java.nio.DirectByteBuffer.<init>(Unknown Source) 
at java.nio.ByteBuffer.allocateDirect(Unknown Source) 
at 
gov.nist.javax.sip.stack.SSLStateMachine.startBuffer(SSLStateMachine.java:181) 
at gov.nist.javax.sip.stack.SSLStateMachine.unwrap(SSLStateMachine.java:238) 
at gov.nist.javax.sip.stack.SSLStateMachine.unwrap(SSLStateMachine.java:174) 
at 
gov.nist.javax.sip.stack.NioTlsMessageChannel.addBytes(NioTlsMessageChannel.java
:165) 
at 
gov.nist.javax.sip.stack.NioTcpMessageChannel.readChannel(NioTcpMessageChannel.j
ava:105) 
at 
gov.nist.javax.sip.stack.NioTcpMessageProcessor$ProcessorTask.read(NioTcpMessage
Processor.java:120) 
at 
gov.nist.javax.sip.stack.NioTcpMessageProcessor$ProcessorTask.run(NioTcpMessageP
rocessor.java:287) 
at java.lang.Thread.run(Unknown Source)

http://stackoverflow.com/questions/3773775/default-for-xxmaxdirectmemorysize . 
It seems that default max . direct. memory size is set to 64M.
While it isn't clear that there is a real problem in JSIP stack, here is few 
reference articles : 
http://stackoverflow.com/questions/6527131/java-using-more-memory-than-the-alloc
ated-memory 
http://www.kdgregory.com/index.php?page=java.byteBuffer 
http://jira.codehaus.org/browse/JETTY-1245

They mainly say that direct byte buffers are resided outside of heap memory, so 
java process could eat much memory than defined by Mx argument.

Ability to configure what kind of buffers will be used by JSIP - direct or 
not-direct ones.

Original issue reported on code.google.com by jean.deruelle on 1 Aug 2012 at 9:46

GoogleCodeExporter commented 9 years ago
tied to https://telestax.zendesk.com/tickets/30883

Original comment by jean.deruelle on 1 Aug 2012 at 9:46

GoogleCodeExporter commented 9 years ago
tied to http://java.net/jira/browse/JSIP-430

Original comment by jean.deruelle on 1 Aug 2012 at 9:59

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 1a6ccf989425.

Fixes http://java.net/jira/browse/JSIP-430

git-svn-id: 
https://svn.java.net/svn/jsip~svn/branches/JAIN-SIP-NIO-year-2012@2137 
8e71dc83-d81e-6649-80f2-80b843a9b2be

Original comment by jean.deruelle on 1 Aug 2012 at 10:01

GoogleCodeExporter commented 9 years ago

Original comment by jean.deruelle on 1 Aug 2012 at 10:02

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 52a6652d0343.

Backport to TelScale branch

Fixes http://java.net/jira/browse/JSIP-430

git-svn-id: 
https://svn.java.net/svn/jsip~svn/branches/JAIN-SIP-NIO-year-2012@2137 
8e71dc83-d81e-6649-80f2-80b843a9b2be
(cherry picked from commit 1a6ccf9894256c6f01521cc1cff4dbb098d17a38)

Original comment by jean.deruelle on 1 Aug 2012 at 10:02

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 6de7904d6b5e.

Fixes http://java.net/jira/browse/JSIP-430

git-svn-id: https://svn.java.net/svn/jsip~svn/trunk@2223 
8e71dc83-d81e-6649-80f2-80b843a9b2be

Original comment by jean.deruelle on 11 Dec 2012 at 2:48

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 52a6652d0343.

Backport to TelScale branch

Fixes http://java.net/jira/browse/JSIP-430

git-svn-id: 
https://svn.java.net/svn/jsip~svn/branches/JAIN-SIP-NIO-year-2012@2137 
8e71dc83-d81e-6649-80f2-80b843a9b2be
(cherry picked from commit 1a6ccf9894256c6f01521cc1cff4dbb098d17a38)

Original comment by jean.der...@telestax.com on 19 Aug 2014 at 4:59