Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.java.* > Newsgroup comp.lang.java.programmer



Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-08-2010, 11:08 PM
Krist
Guest
 
Posts: n/a
Default What is the difference between Memory Usage and Heap Usage in my JVMMetrics ?

Hi all,

In my Apps Server console (OC4J) JVM Metrics, there are two columns
about memory :

Memory Usage (MB) -> Shows the amount of physical memory used by the
JVM.
Heap Usage (MB) -> Shows the amount of heap space used by the
JVM.

(heap usage seems to be up and down, but memory usage is never going
down, even when all user already loggout.)

What are the difference between the two ?

Thank you for your help,
xtanto
Reply With Quote
Alt Today
Advertising
Google Adsense
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 02-09-2010, 12:27 AM
Roedy Green
Guest
 
Posts: n/a
Default Re: What is the difference between Memory Usage and Heap Usage in my JVM Metrics ?

On Mon, 8 Feb 2010 15:08:41 -0800 (PST), Krist <krislioe@gmail.com>
wrote, quoted or indirectly quoted someone who said :

>
>(heap usage seems to be up and down, but memory usage is never going
>down, even when all user already loggout.)
>
>What are the difference between the two ?


Your variables you allocate with new go on the heap. Other memory use
includes the class files, the machine language equivalents of the
class files, the native code for the interpreter/hot spot.
--
Roedy Green Canadian Mind Products
http://mindprod.com

Every compilable program in a sense works. The problem is with your unrealistic expections on what it will do.
Reply With Quote
  #3 (permalink)  
Old 02-09-2010, 01:09 AM
Arne Vajhøj
Guest
 
Posts: n/a
Default Re: What is the difference between Memory Usage and Heap Usage inmy JVM Metrics ?

On 08-02-2010 18:08, Krist wrote:
> In my Apps Server console (OC4J) JVM Metrics, there are two columns
> about memory :
>
> Memory Usage (MB) -> Shows the amount of physical memory used by the
> JVM.
> Heap Usage (MB) -> Shows the amount of heap space used by the
> JVM.
>
> (heap usage seems to be up and down, but memory usage is never going
> down, even when all user already loggout.)
>
> What are the difference between the two ?


I will guess that:

memory usage = memory the JVM has allocated from the OS

heap usage = memory your app has allocated from the JVM

With two points:

1) the JVM need memory for internal stuff so memory usage
is greater than heap usage
2) even if your app releases memory then the JVM may not
release it to the OS but keep it around just in case
you will need it again

Arne


Reply With Quote
  #4 (permalink)  
Old 02-09-2010, 01:15 AM
Krist
Guest
 
Posts: n/a
Default Re: What is the difference between Memory Usage and Heap Usage in myJVM Metrics ?

On 9 Feb, 08:09, Arne Vajhøj <a...@vajhoej.dk> wrote:
> On 08-02-2010 18:08, Krist wrote:
>
> > In my Apps Server console (OC4J) JVM Metrics, *there are two columns
> > about memory :

>
> > Memory Usage (MB) * -> *Shows the amount of physical memory used bythe
> > JVM.
> > Heap Usage (MB) * * * -> *Shows the amount of heap space used by the
> > JVM.

>
> > (heap usage seems to be up and down, but memory usage is never going
> > down, even when all user already loggout.)

>
> > What are the difference between the two ?

>
> I will guess that:
>
> memory usage = memory the JVM has allocated from the OS
>
> heap usage = memory your app has allocated from the JVM
>
> With two points:
>
> 1) the JVM need memory for internal stuff so memory usage
> * * is greater than heap usage
> 2) even if your app releases memory then the JVM may not
> * * release it to the OS but keep it around just in case
> * * you will need it again
>
> Arne


Hi sirs,
Thank you for your reply.

So, is it only the heap area that I can tune ? (GC & Memory leak)

How can I also tune the 'memory for internal stuff' usage ?

Thank you,
Krist





Reply With Quote
  #5 (permalink)  
Old 02-09-2010, 01:22 AM
Arne Vajhøj
Guest
 
Posts: n/a
Default Re: What is the difference between Memory Usage and Heap Usage inmy JVM Metrics ?

On 08-02-2010 20:15, Krist wrote:
> On 9 Feb, 08:09, Arne Vajhøj<a...@vajhoej.dk> wrote:
>> On 08-02-2010 18:08, Krist wrote:
>>> In my Apps Server console (OC4J) JVM Metrics, there are two columns
>>> about memory :

>>
>>> Memory Usage (MB) -> Shows the amount of physical memory used by the
>>> JVM.
>>> Heap Usage (MB) -> Shows the amount of heap space used by the
>>> JVM.

>>
>>> (heap usage seems to be up and down, but memory usage is never going
>>> down, even when all user already loggout.)

>>
>>> What are the difference between the two ?

>>
>> I will guess that:
>>
>> memory usage = memory the JVM has allocated from the OS
>>
>> heap usage = memory your app has allocated from the JVM
>>
>> With two points:
>>
>> 1) the JVM need memory for internal stuff so memory usage
>> is greater than heap usage
>> 2) even if your app releases memory then the JVM may not
>> release it to the OS but keep it around just in case
>> you will need it again


> So, is it only the heap area that I can tune ? (GC& Memory leak)
>
> How can I also tune the 'memory for internal stuff' usage ?


I don't think you have much control over what the JVM use for
itself and for byte code and JIT'ed code.

Arne
Reply With Quote
  #6 (permalink)  
Old 02-09-2010, 03:42 PM
Roedy Green
Guest
 
Posts: n/a
Default Re: What is the difference between Memory Usage and Heap Usage in my JVM Metrics ?

On Mon, 8 Feb 2010 17:15:54 -0800 (PST), Krist <krislioe@gmail.com>
wrote, quoted or indirectly quoted someone who said :

>How can I also tune the 'memory for internal stuff' usage ?


see http://mindprod.com/jgloss/javaexe.html
for some of the parameters you can tweak.
Follow links to some even more esoteric ones.

You can also use Jet which adjusts memory usage as it runs in some
intelligent way.
see http://mindprod.com/jgloss/jet.html
--
Roedy Green Canadian Mind Products
http://mindprod.com

Every compilable program in a sense works. The problem is with your unrealistic expections on what it will do.
Reply With Quote
  #7 (permalink)  
Old 02-09-2010, 03:44 PM
Roedy Green
Guest
 
Posts: n/a
Default Re: What is the difference between Memory Usage and Heap Usage in my JVM Metrics ?

On Mon, 8 Feb 2010 17:15:54 -0800 (PST), Krist <krislioe@gmail.com>
wrote, quoted or indirectly quoted someone who said :

>How can I also tune the 'memory for internal stuff' usage ?


Try a variety of constellations of options and see which actually
works better. Bigger is not necessarily better. What is best depends
on your machine and what else in running in your machine at the time.
--
Roedy Green Canadian Mind Products
http://mindprod.com

Every compilable program in a sense works. The problem is with your unrealistic expections on what it will do.
Reply With Quote
  #8 (permalink)  
Old 02-09-2010, 03:56 PM
Lew
Guest
 
Posts: n/a
Default Re: What is the difference between Memory Usage and Heap Usage inmy JVM Metrics ?

Krist wrote:
>> How can I also tune the 'memory for internal stuff' usage ?


Read the documentation.

<http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html>
<http://java.sun.com/javase/6/docs/te...rgonomics.html
<http://java.sun.com/performance/reference/whitepapers/tuning.html>

You can search java.sun.com with its search options, or use your favorite
search engine.

In addition to the various JVM options, how you code your programs affects
memory usage. Java is generally optimized for frequent creation of
short-lived objects, which supports a programming style of least-scoped
variables, a best practice anyway.

--
Lew
Reply With Quote
  #9 (permalink)  
Old 02-10-2010, 12:44 AM
Arne Vajhøj
Guest
 
Posts: n/a
Default Re: What is the difference between Memory Usage and Heap Usage inmy JVM Metrics ?

On 09-02-2010 10:56, Lew wrote:
> Krist wrote:
>>> How can I also tune the 'memory for internal stuff' usage ?

>
> Read the documentation.
>
> <http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html>
> <http://java.sun.com/javase/6/docs/te...rgonomics.html
> <http://java.sun.com/performance/reference/whitepapers/tuning.html>
>
> You can search java.sun.com with its search options, or use your
> favorite search engine.
>
> In addition to the various JVM options, how you code your programs
> affects memory usage. Java is generally optimized for frequent creation
> of short-lived objects, which supports a programming style of
> least-scoped variables, a best practice anyway.


The 'memory for internal stuff' is all the memory except
the java variables in heap that gets GC'ed.

As far as I know there are very few options to control that.

Arne
Reply With Quote
 
Reply

Popular Tags in the Forum
difference, heap, jvmmetrics, memory, usage

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory usage problem of twisted server Victor Lin Newsgroup comp.lang.python 1 01-22-2010 06:33 AM
Develop Update Server in Java Simon Newsgroup comp.lang.java.programmer 27 10-31-2009 05:11 PM
Statement on Schildt submitted to wikipedia today spinoza1111 Newsgroup comp.lang.c.moderated 56 09-21-2009 07:25 PM
how to enlarger Java heap size? Marteno Rodia Newsgroup comp.lang.java.programmer 12 09-19-2009 06:04 PM
Proc Report using RTF Out of Memory (8.1) on Mainframe McDonald, John M Newsgroup comp.soft-sys.sas 0 08-06-2005 07:25 PM



Language 1 | C | C++ | Php | Python | Lisp | Perl | Ruby | Java | Pascal | Basic | Language 2 | Databases | Oracle | Mysql | Access | Drupal
All times are GMT. The time now is 07:08 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.