aspose file tools
The moose likes Java in General and the fly likes Why is the memory usage ZERO bytes of this program Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Why is the memory usage ZERO bytes of this program" Watch "Why is the memory usage ZERO bytes of this program" New topic
Author

Why is the memory usage ZERO bytes of this program

Mustafa Garhi
Ranch Hand

Joined: Nov 05, 2008
Posts: 111


I always get 0 as the System Print

However if i increase the size of for loop it fetches me some bytes as the output.

Have been scratching my head since quite a time now

Any help would be appreciated.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read.

You can edit your post by using the button.
Mustafa Garhi
Ranch Hand

Joined: Nov 05, 2008
Posts: 111
Thanks bro ..

It looks neater now .
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It does :)

The numbers returned by these calls are approximate and don't necessarily reflect exact memory usage statistics (you'd probably need to use the JVM hooks for exact details). Use a higher number and you'll start seeing a difference at some point. *Which* point is likely JVM- and runtime-option dependent. For example, on my Ubuntu machine, I get a non-zero value if I change the count to 235, and that value stays constant again up until 788, at which point it more than doubles.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Why is the memory usage ZERO bytes of this program
 
Similar Threads
what is the size of an object?
How to Determine an Objects Size ?
Getting hardware details,processor type through java
Object size in memory?
Bitsets and memory consumption