dev@glassfish.java.net

Re: Heap Memory

From: Bharath Mundlapudi <Bharath.Mundlapudi_at_Sun.COM>
Date: Tue, 08 Jul 2008 11:45:36 -0700

Hi Susana,

          Did you try setting -Xms (Min Heap Size) to be equal to -Xmx
(Max Heap Size)?

Lets say you wanted 1024MB for your application then you can set -Xms
1024m -Xmx 1024m. This forces the JVM to commit 1024MB upon startup. If
you don't set -Xms then JVM commits whatever application requires and
but allowed to max till -Xmx heap size.

In your current case, your application might be using 64MB upon startup
and allowed to grow till -Xmx heap size. But you can force JVM to
allocate/commit the initial memory you want with -Xms. Still, the
maximum memory required for your application is controlled by -Xmx.

If you want to verify this, you can use jconsole (memory tab) to see
used memory vs committed memory for your application.

Let us know if you have more questions,
-Bharath

Glassfish
http://www.sun.com/software/products/appsrvr/support.jsp



>Hi Bharath
>
> Yes, we work with Glassfish and Netbeans. We tried to increase heap java
>memory with -Xmx jvm option but we can't increase more than 64MB
>
> Working directly with Netbeans heap memory increase to 1024MB, but not
>without Netbeans.
>
> Maybe we must change another jvm option?
>
> thanks
>
> Susana.
>
>
>
>>I am assuming you are programming your application on Glassfish?
>>
>>Please refer heap sizing section here
>>http://java.sun.com/performance/reference/whitepapers/tuning.html
>>
>>Also you may want to refer,
>>http://java.sun.com/docs/hotspot/HotSpotFAQ.html#gc_heap_32bit
>>
>>You can increase the heap size with -Xmx jvm option.
>>
>>-Bharath
>>
>>
>>
>>>We are programming an application that requires to work with 3 Gb of
>>>heap
>>>memory from a java virtual machine but, in spite we had prove with the
>>>Xmx parameter in order to obtain the said necessary memory level, we had
>>>only obtained 64 Mb (we had used MemoryMXBean and MemoryUsage in order to
>>>know the disposed memory level)
>>>
>>>Please, would you tell us how to increase the heap memory level at the
>>>java virtual machine?
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>>
>>>
>>>
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>>
>>
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
>
>