Re: [OT] how to calculate the size of an object

2004-07-09 Thread Kris Schneider
doesn't necessarily mean in memory size). > > > > Just wait til those slackers at Sun at a Object.sizeof() method in jdk1.9 > or > > > > something lame. > > > > BAL > > > > >From: Navjot Singh <[EMAIL PROTECTED]> > > >T

Re: [OT] how to calculate the size of an object

2004-07-09 Thread Erik Weber
c String getID() { return ID; } public void setAge(int age) { this.age = age; } public int getAge() { return age; } } -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Thursday, July 08, 2004 10:57 PM To: Struts Users Mailing List Subject:

RE: [OT] how to calculate the size of an object

2004-07-08 Thread simarjit singh
ow to calculate the size of an object Also remember that when you serialize an Object (if I am not mistaken), all the Objects referred to by that Object get serialized too (unless the references are transient). In addition, there is serialization overhead (protocol info that is not actually part of

Re: [OT] how to calculate the size of an object

2004-07-08 Thread Kris Schneider
ect.sizeof() method in jdk1.9 or > > something lame. > > BAL > > >From: Navjot Singh <[EMAIL PROTECTED]> > >To: Struts Users Mailing List <[EMAIL PROTECTED]> > >Subject: Re: [OT] how to calculate the size of an object > >Date: Thu, 08 Jul 2004

Re: [OT] how to calculate the size of an object

2004-07-08 Thread Brian Lee
ect.sizeof() method in jdk1.9 or something lame. BAL From: Navjot Singh <[EMAIL PROTECTED]> To: Struts Users Mailing List <[EMAIL PROTECTED]> Subject: Re: [OT] how to calculate the size of an object Date: Thu, 08 Jul 2004 22:16:12 +0530 hi, Thanks for the link but this is very naive way of

Re: [OT] how to calculate the size of an object

2004-07-08 Thread Erik Weber
Also remember that when you serialize an Object (if I am not mistaken), all the Objects referred to by that Object get serialized too (unless the references are transient). In addition, there is serialization overhead (protocol info that is not actually part of your Object but that is required

Re: [OT] how to calculate the size of an object

2004-07-08 Thread Erik Weber
public static long getSize(LDIFData data) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(baos); out.writeObject(data); out.close(); return baos.toByteArray().length; } catch (Exception e) { e.printStackTrace(); return -1; } } John M

Re: [OT] how to calculate the size of an object

2004-07-08 Thread DGraham
ot; <[EMAIL PROTECTED]> To Struts Users Mailing List <[EMAIL PROTECTED]> cc Subject Re: [OT] how to calculate the size of an object hi, Thanks for the link but this is very naive way of doing it. I am leaving it to the mercy of gc. What this method is doing 1. run gc

RE: [OT] how to calculate the size of an object

2004-07-08 Thread Jim Barrows
> -Original Message- > From: Navjot Singh [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 08, 2004 9:46 AM > To: Struts Users Mailing List > Subject: Re: [OT] how to calculate the size of an object > > > hi, > > Thanks for the link but this is very

Re: [OT] how to calculate the size of an object

2004-07-08 Thread Navjot Singh
mp;lr=&ie=UTF-8&q=size+java+object The first one looks promising. Dennis *Navjot Singh <[EMAIL PROTECTED]>* 07/08/2004 11:57 AM Please respond to "Struts Users Mailing List" <[EMAIL PROTECTED]> To Struts Users Mailing List <[EMAIL PROTECTED]> cc

RE: [OT] how to calculate the size of an object

2004-07-08 Thread Jim Barrows
Whoops.. that should the problem with the first one on the list.. :) I know Bad code monkey no caffeine. > -Original Message- > From: Jim Barrows > Sent: Thursday, July 08, 2004 9:24 AM > To: Struts Users Mailing List > Subject: RE: [OT] how to calculate the si

RE: [OT] how to calculate the size of an object

2004-07-08 Thread Jim Barrows
with a negative number. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, July 08, 2004 9:10 AM To: Struts Users Mailing List Subject: Re: [OT] how to calculate the size of an object http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=size

Re: [OT] how to calculate the size of an object

2004-07-08 Thread DGraham
ling List <[EMAIL PROTECTED]> cc Subject [OT] how to calculate the size of an object hi, I use SAX parser to load an LDIF file into memory. Whatsoever data i read, i fill into an object. I need to know *the size of LDIFData object* at runtime. How to do that? Well the class

RE: [OT] how to calculate the size of an object

2004-07-08 Thread Jim Barrows
java.io.File has the length() method to return the length of the file. > -Original Message- > From: Navjot Singh [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 08, 2004 8:58 AM > To: Struts Users Mailing List > Subject: [OT] how to calculate the size of an object > &

Re: [OT] how to calculate the size of an object

2004-07-08 Thread John Moore
Navjot Singh wrote: I use SAX parser to load an LDIF file into memory. Whatsoever data i read, i fill into an object. I need to know *the size of LDIFData object* at runtime. How to do that? Well the class structure is something like this public class LDIFData{ ArrayList cards; // collection of C

[OT] how to calculate the size of an object

2004-07-08 Thread Navjot Singh
hi, I use SAX parser to load an LDIF file into memory. Whatsoever data i read, i fill into an object. I need to know *the size of LDIFData object* at runtime. How to do that? Well the class structure is something like this public class LDIFData{ ArrayList cards; // collection of Card