memory-use measurement

R

Reiner Funck

Hallo,

my memory-use measurement for a Java-process (Java 1.5)
shows 170000 Bytes.
(memoryuse = Runtime.totalMemory() - Runtime.freeMemory())

The simultaneously measurement with ps shows 64000 Bytes.
(Suse 9.1, kernel 2.6.4)

What is wrong?

Many thanks for help
Reiner
 
C

Chris Smith

Reiner said:
my memory-use measurement for a Java-process (Java 1.5)
shows 170000 Bytes.
(memoryuse = Runtime.totalMemory() - Runtime.freeMemory())

The simultaneously measurement with ps shows 64000 Bytes.
(Suse 9.1, kernel 2.6.4)

What is wrong?

Perhaps nothing. The first bit of code measures the size of the used
heap. The second could be any number of things, depending on what
column of the ps output you're reading. If you're looking at physical
RAM in ps, for example, then the discrepancy could come from part of the
heap being paged out at the moment.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top