I would appreciate some help regarding Java's memory model.
At times I get
There I am creating a new socket for my http client:
As you can see above I already introduced some logging when this OutOfMemory occurs. The memory looks like this at that point of time:
So I am not really a professional regarding Java's memory model, but why does the VM not just increase the commited space since max space is not full?
Are there any tuning options instead of increasing the total memory, which is not an option in my case?
Thanks for your help!
Michael
At times I get
Code:
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:574)
at org.apache.commons.httpclient.util.TimeoutController.execute(TimeoutController.java:61)
at org.apache.commons.httpclient.util.TimeoutController.execute(TimeoutController.java:82)
at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory.createSocket(ControllerThreadSocketFactory.java:95)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:128)
at wora.service.access.http.MeasurementProtocolSocketFactory.createSocket(MeasurementProtocolSocketFactory.java:61)
Java:
public Socket createSocket(final String host, final int port,
final InetAddress localAddress, final int localPort,
final HttpConnectionParams params) throws IOException {
startTime.set(System.currentTimeMillis());
Socket socket;
try {
socket = delegate.createSocket(host, port, localAddress, localPort,
params);
return socket;
} catch (OutOfMemoryError e) {
ServerHealthBacking.logIt();
throw (e);
}
}
As you can see above I already introduced some logging when this OutOfMemory occurs. The memory looks like this at that point of time:
Code:
heap: init = 0(0K) used = 28684528(28012K) committed = 45522944(44456K) max = 166526976(162624K) commited usage=63% max usage=17%
non heap: init = 8552448(8352K) used = 41372552(40402K) committed = 42303488(41312K) max = 100663296(98304K) commited usage=97% max usage=41%
Code Cache - NOW : init = 163840(160K) used = 6639296(6483K) committed = 6651904(6496K) max = 33554432(32768K) commited usage=99% max usage=19%
Code Cache - COLLECTION : null
Eden Space - NOW : init = 524288(512K) used = 1419056(1385K) committed = 2949120(2880K) max = 10354688(10112K) commited usage=48% max usage=13%
Eden Space - COLLECTION : init = 524288(512K) used = 0(0K) committed = 2949120(2880K) max = 10354688(10112K) commited usage=0% max usage=0%
Survivor Space - NOW : init = 65536(64K) used = 67472(65K) committed = 327680(320K) max = 1245184(1216K) commited usage=20% max usage=5%
Survivor Space - COLLECTION : init = 65536(64K) used = 67472(65K) committed = 327680(320K) max = 1245184(1216K) commited usage=20% max usage=5%
Tenured Gen - NOW : init = 1441792(1408K) used = 27198000(26560K) committed = 42246144(41256K) max = 154927104(151296K) commited usage=64% max usage=1
7%
Tenured Gen - COLLECTION : init = 1441792(1408K) used = 16836616(16442K) committed = 28061696(27404K) max = 154927104(151296K) commited usage=59% max
usage=10%
Perm Gen - NOW : init = 8388608(8192K) used = 34733256(33919K) committed = 35651584(34816K) max = 67108864(65536K) commited usage=97% max usage=51%
Perm Gen - COLLECTION : init = 8388608(8192K) used = 33552040(32765K) committed = 33554432(32768K) max = 67108864(65536K) commited usage=99% max usage
=49%
So I am not really a professional regarding Java's memory model, but why does the VM not just increase the commited space since max space is not full?
Are there any tuning options instead of increasing the total memory, which is not an option in my case?
Thanks for your help!
Michael
Zuletzt bearbeitet von einem Moderator: