This forum has been archived. Please start a new discussion on GitHub.

OutOfMemmoryError: mmAlloc


While sending a huge string (size could be even 54 MB) to the ice servant, I am getting following exception. But sometimes, I am able to send the same string to the same Ice service. I guess this is not related to Ice framework. But it would be really helpful if anyone can provide some info about this problem.

Is it just memory unavailablity problem?

JDK : Jrockit

Please let me know if any other info is required.

java.lang.OutOfMemoryError: mmAllocLargeArray(jniGetVMThread(env), (ClassP)c, (ObjectP*)res, len) : mmAllocLargeArray(jniGetVMThread(env), (ClassP)c, (ObjectP*)res, len)
java.lang.StringCoding.trim([BI)[B(Unknown Source)
java.lang.StringCoding.access$700([BI)[B(Unknown Source)
java.lang.StringCoding$CharsetSE.encode([CII)[B(Unknown Source)
java.lang.StringCoding.encode(Ljava/lang/String;[CII)[B(Unknown Source)
java.lang.String.getBytes(Ljava/lang/String;)[B(Unknown Source)
jrockit.reflect.NativeMethodInvoker.invoke0(Ljava/lang/Object;ILjava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
jrockit.reflect.NativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(Unknown Source);)Ljava/lang/Object;(
$Proxy32.addDocument(Lcom/gale/cs/vault/model/Document;)Lcom/gale/cs/vault/model/DocumentId;(Unknown Source);Lcom/gale/cs/workflow/FeedInput;Ljava/util/List;)V(

Thanks & Regards,
Sivaprakash S


  • xdm
    xdm La Coruña, Spain
    first of all be sure that your system has available memory when it crash

    if you are in linux side check if you are exceding system limits with ulimit, ulimit -a list you the limits for a user.

    You must adjust your jvm params to allow more memory, this option can help. I think the default is 32mb for clients and 64 for servers

    //sets the maximum heap size to 256mb

    for a extensive list of jvm params check this url

    I hope this help you
  • I observed that it is because of lack of memory. Also, I observed that it requires almost memory of 10 times more than the actual content to recieve from the ICE server. Is my observation correct?

    Suppose if I have to retreive content (assume size as 6MB) from an ICE server, i had to set memory heap size as 60MB while ruinning the client. I am using JDK1.4.2_8

    Thanks & Regards,
    Sivaprakash Selvaraj,
    HTC Global Services.
  • Before we can help you, can you please update your signatures as described in this thread.


  • marc
    marc Florida
    Please let us also know which Ice version you are using.
  • Ice Version

    I am using ICE Version 3.0.1
  • mes
    mes California

    I've confirmed that Ice for Java is using a lot of memory when marshaling strings. We'll fix this in the next release.

    Thanks for reporting this problem.

    Take care,
    - Mark