It's all about the answers!

Ask a question

Out Of Memory Error when trying to lookup asset type


Revathi Subramanian (369) | asked Jun 29 '10, 10:06 a.m.
I have a very simple program that I am running in eclipse. All it does is get a session to a RAM server and looks up an asset type. This is the program:

public static void main(String[] args) {
String ramURL = args;
String ramUserId = args;
String ramPassword = args;

RAMSession session = new RAMSession(ramURL, ramUserId, ramPassword);

try {
RAMAssetType assetType = session.getAssetType("test");
if (assetType == null) {
System.out.println("Asset type is null");
} else {
System.out.println("Asset type was found");
}
} catch(Exception e) {
e.printStackTrace();
}
}


This is the error it generates:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.<init>(String.java:215)
at java.lang.StringBuffer.toString(StringBuffer.java:585)
at org.apache.axis.message.MessageElement.getAsString(MessageElement.java:1114)
at org.apache.axis.message.MessageElement.toString(MessageElement.java:1272)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at com.ibm.ram.internal.client.RAMHTTPSender.invoke(RAMHTTPSender.java:41)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.ibm.ram.repository.web.ws.core.v72.RAM1SoapBindingStub.getAllAssetTypes(RAM1SoapBindingStub.java:9319)
at com.ibm.ram.internal.access.ws.RAMv72.getAllAssetTypes(RAMv72.java:104)
at com.ibm.ram.internal.client.util.SessionManager.getAssetTypeCache(SessionManager.java:100)
at com.ibm.ram.client.RAMSession.initAssetTypeCache(RAMSession.java:1823)
at com.ibm.ram.client.RAMSession.getAssetType(RAMSession.java:1680)
at iram.test.iRAMUtils.main(iRAMUtils.java:17)

I am able to browse and search the same RAM repo without any issues using the RAM rich client.

How can I get past this error? I have tried increasing the vmargs settings in the eclipse.ini file, but it did not help.

One answer



permanent link
Kevin Bauer (34621) | answered Jun 29 '10, 2:32 p.m.
JAZZ DEVELOPER
So this is indicating that your client is running out of memory. It seems odd that your would not run out of memory in other operations (search, browse etc).

This call is trying to get the descriptions of all the asset types in your server. Do you know how may you have or why this may be excessively large?

What value are you using for Xmx when you updated your vmargs?


I have a very simple program that I am running in eclipse. All it does is get a session to a RAM server and looks up an asset type. This is the program:

public static void main(String[] args) {
String ramURL = args;
String ramUserId = args;
String ramPassword = args;

RAMSession session = new RAMSession(ramURL, ramUserId, ramPassword);

try {
RAMAssetType assetType = session.getAssetType("test");
if (assetType == null) {
System.out.println("Asset type is null");
} else {
System.out.println("Asset type was found");
}
} catch(Exception e) {
e.printStackTrace();
}
}


This is the error it generates:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.<init>(String.java:215)
at java.lang.StringBuffer.toString(StringBuffer.java:585)
at org.apache.axis.message.MessageElement.getAsString(MessageElement.java:1114)
at org.apache.axis.message.MessageElement.toString(MessageElement.java:1272)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at com.ibm.ram.internal.client.RAMHTTPSender.invoke(RAMHTTPSender.java:41)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.ibm.ram.repository.web.ws.core.v72.RAM1SoapBindingStub.getAllAssetTypes(RAM1SoapBindingStub.java:9319)
at com.ibm.ram.internal.access.ws.RAMv72.getAllAssetTypes(RAMv72.java:104)
at com.ibm.ram.internal.client.util.SessionManager.getAssetTypeCache(SessionManager.java:100)
at com.ibm.ram.client.RAMSession.initAssetTypeCache(RAMSession.java:1823)
at com.ibm.ram.client.RAMSession.getAssetType(RAMSession.java:1680)
at iram.test.iRAMUtils.main(iRAMUtils.java:17)

I am able to browse and search the same RAM repo without any issues using the RAM rich client.

How can I get past this error? I have tried increasing the vmargs settings in the eclipse.ini file, but it did not help.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.