how to find out how many memory is used for NIO
is there any way to find out how many memory is used for nio in a virtual machine. ?
I know that is possible to find out how many total, free and used memory the heap has by using java.lang.Runtime#totalMemory...
We sometimes expect errors that it is not possible to create any more connections because of the NIO memory size but the heap is still ok. Today we had an error where 170mbytes of heap where left but it was not possible to create new tcp connections because of an exception:
javax.naming.NamingException: java.net.SocketException: No buffer space available (maximum connections reached?): connect
The number of TCP-Connections was ok (<500).
It would be very nice if someone knows how to find out how the amount of memory that NIO buffers use can be determined within Java 1.4.
best regards
benjamin

