Re: [algogeeks] how can i find size of an object in java

2009-11-25 Thread Danny Trieu
Use JNI to do native call. Otherwise, use Sigar api from http://www.hyperic.com/products/sigar.html. --danny On Tue, Nov 24, 2009 at 11:07 AM, Abhijeet Kumar wrote: > How can i find size of an object in java > plsss answer asap > > -- > You received this message because you are subscribed t

Re: [algogeeks] how can i find size of an object in java

2009-11-25 Thread Antony Vincent Pandian.S.
But you cant actually say that this is the size of the object from calling freememory before and after object creation.. On Wed, Nov 25, 2009 at 5:15 PM, Phani Kumar wrote: > java.lang.Runtime class has a method* freeMemory >

Re: [algogeeks] how can i find size of an object in java

2009-11-25 Thread Phani Kumar
java.lang.Runtime class has a method* freeMemory ()* which returns the amount of free memory in the JVM. You can call this method before creating an object and after creating an object. On Wed, Nov 25, 2009 at 4:04

Re: [algogeeks] how can i find size of an object in java

2009-11-25 Thread daizi sheng
java normally pre-alloc much memory and so you have no way to get the actual heap usage with simple method. normally for a given jvm, the size of an object can be calculated statically. what you need is to read source code of jvm, :) anyway, you can simple estimate size of an object as the summati

Re: [algogeeks] how can i find size of an object in java

2009-11-25 Thread Abhijeet Kumar
how do i measure the JVM memory ??? can u specify a command or class to use?? On Wed, Nov 25, 2009 at 8:12 AM, Chakravarthi Muppalla wrote: > measure jvm memory usage before/after creating ur object; but it is not > assured to give the correct size(gc). > or u can use a premain agent. > > On Wed,

Re: [algogeeks] how can i find size of an object in java

2009-11-24 Thread Chakravarthi Muppalla
measure jvm memory usage before/after creating ur object; but it is not assured to give the correct size(gc). or u can use a premain agent. On Wed, Nov 25, 2009 at 12:37 AM, Abhijeet Kumar wrote: > How can i find size of an object in java > plsss answer asap > > -- > You received this messag

[algogeeks] how can i find size of an object in java

2009-11-24 Thread Abhijeet Kumar
How can i find size of an object in java plsss answer asap -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr.