Link to home
Start Free TrialLog in
Avatar of sontnvn
sontnvn

asked on

Max-heap-size of JVM

Dear Experts,
I set these properites in JLNP file
<j2se version="1.3+" initial-heap-size="64m"/>
<j2se version="1.3+" max-heap-size="256m"/>
Result:
I catch OutOfMemory exception when JVM reach 65088 MB
When I change initial-heap-size="64m" ==> initial-heap-size="128m"
The I couldnot start jws.
Could you help me increase more heap size of JVM?
Thank you very much for your help.
Avatar of Mick Barry
Mick Barry
Flag of Australia image

> The I couldnot start jws.

why not?
Also perhaps should be:

<j2se version="1.3+" initial-heap-size="64m" max-heap-size="256m"/>
Avatar of sontnvn
sontnvn

ASKER

> <j2se version="1.3+" initial-heap-size="64m" max-heap-size="256m"/>
===> Nothing changed
> ===> Nothing changed

Can you explain exactly what is happening.
Avatar of sontnvn

ASKER

Case 1:
<j2se version="1.3+" initial-heap-size="64m"/>
<j2se version="1.3+" max-heap-size="256m"/>
Case2:
<j2se version="1.3+" initial-heap-size="64m" max-heap-size="256m"/>

In both case, My application throw OutOfMemory exception. I trace memory information and this is the result:
Runtime.getRuntime().totalMemory()/1024 = 65088
Runtime.getRuntime().freeMemory()/1024 = 17638
Runtime.getRuntime().maxMemory()/1024 = 131072
Physical memory is 1GB, why Runtime.getRuntime().maxMemory()/1024 always return 131072?
Anyway, when I run my application by java command line and set -Xmx = 256 then it ran well.
> Physical memory is 1GBwhy Runtime.getRuntime().maxMemory()/1024 always return 131072?

Physical memory is not reltaed, the VM has it's own allocated memory space.
Avatar of sontnvn

ASKER

How can we force JVM increase its maxMemory size? (JWS environment)
When the application throw OutOfMemory exception, task manager (Win2k) report Mem Usage = ~110 000MB.
> How can we force JVM increase its maxMemory size?

That is supposedly what max-heap-size should be doing.

Can you post your complete jnlp file.
Avatar of sontnvn

ASKER

Below is our jnlp file

<?xml version="1.0" encoding="utf-8"?>

<jnlp spec="1.0+"
      codebase="http://napple/nApple"
      href="nApple.jnlp">
   <resources>
      <!--<j2se version="1.3+" initial-heap-size="128m" max-heap-size="256m"/> -->
      <j2se version="1.3+" initial-heap-size="64m"/>
      <j2se version="1.3+" max-heap-size="128m"/>
      <j2se version="1.3+" href="http://java.sun.com/products/autodl/j2se"/>
      <jar href="nApple.jar" main="true" download="eager"/>
   </resources>
   <application-desc main-class="com.ykgw.ees.ui.NApple">
         <argument>10</argument>
         <argument>1</argument>
         <argument>http://napple/nApple/nApple.wsdl</argument>
         <argument>http://tempuri.org/nApple/message/</argument>
         <argument>http://schemas.xmlsoap.org/soap/encoding/</argument>
      <argument>http://tempuri.org/nApple/action/PlanDispatcher</argument>
      <argument>50</argument>
   </application-desc>
</jnlp>

>That is supposedly what max-heap-size should be doing.
==> That mean we cannot change this value?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial