Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Max-heap-size of JVM

Posted on 2003-11-02
12
Medium Priority
?
2,040 Views
Last Modified: 2013-11-23
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.
0
Comment
Question by:sontnvn
  • 8
  • 4
12 Comments
 
LVL 92

Expert Comment

by:objects
ID: 9669196
> The I couldnot start jws.

why not?
0
 
LVL 92

Expert Comment

by:objects
ID: 9669276
Also perhaps should be:

<j2se version="1.3+" initial-heap-size="64m" max-heap-size="256m"/>
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:sontnvn
ID: 9670385
> <j2se version="1.3+" initial-heap-size="64m" max-heap-size="256m"/>
===> Nothing changed
0
 
LVL 92

Expert Comment

by:objects
ID: 9674454
> ===> Nothing changed

Can you explain exactly what is happening.
0
 

Author Comment

by:sontnvn
ID: 9675032
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.
0
 
LVL 92

Expert Comment

by:objects
ID: 9675083
> 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.
0
 

Author Comment

by:sontnvn
ID: 9675792
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.
0
 
LVL 92

Expert Comment

by:objects
ID: 9675811
> 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.
0
 

Author Comment

by:sontnvn
ID: 9676084
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?
0
 
LVL 92

Accepted Solution

by:
objects earned 750 total points
ID: 9676191
Try with only one j2se entry.
0
 
LVL 92

Expert Comment

by:objects
ID: 9676511
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question