determining class sizes

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

determining class sizes

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:24 pm

by johnmunro >> Fri, 30 May 2003 12:27:20 GMT

I'd like to write a jadescript that you pass a Class and which displays the number of bytes that instances of this class will take up in the database. Basically I'm sick of people asking me how much space a system with x million instances of class y will take up, because I can never remember all of the rules about collections and oid lengths and headers etc.

Has anyone done anything like this? Is there a reference anywhere of this information? I remember seeing parts of the information I need scattered about the pdf files, but I was hoping someone had collected it all somewhere...


--
John Munro

Synergist Limited - Home of FileVisionT
The Bioscience Innovation Centre
Cowley Road, Cambridge, UK
CB4 0DS
Telephone: +44 (0) 1223 478200
Fax: +44 (0) 1223 477969
Email: john.munro@filevision.com
Web: http://www.filevision.com

The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact Synergist Limited immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. Synergist Limited cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform Synergist Limited.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: determining class sizes

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:24 pm

by allistar >> Sun, 1 Jun 2003 7:57:20 GMT

Hi John,
One of the pdf files (can't remember the exact one, but from memory it is the one that contains the JOMAPI reference) spells out how much space is taken up by each property type, and also byt the object headers.

You could write a script that iterates through all properties on a class and based on the sizes found in the aforementioned pdf you could sum them up and mutliply by the number of objects.

I don't think it spells out how many bytes each collection block takes up, and I don't know that you would be able to tell how many blocks a collection will have based on the number of objects in it. For not many objects it wouldn't make much difference but have a collection with 10,000,00 would take up a noticable amount of space.

The other way is to set the intial file size and file growth increment in the ini file to a small number and then create a million objects and see how much space is taken.

Regards,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz
*NEW* Simple web access to Jade at: www.silvermoon.co.nz/jhp.html ------------------------------------------------------------------

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: determining class sizes

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:24 pm

by Patwos >> Tue, 3 Jun 2003 2:28:47 GMT

Further to Allistar's message, if you run a certify of the mapfile containing instances of the class in question you can find out how large each instance is in bytes. Of course, if you have exclusive subobjects, including Slobs and Blobs, then it won't be a complete picture either but good luck to you working out how large a million instances will be if each instance contains an unknown amout of Slob/Blob data. ;-)

Pat.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: determining class sizes

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:24 pm

by cnwjhp1 >> Tue, 3 Jun 2003 3:40:11 GMT

For help with collection info, check out Dictionary::getStatistics():String (undocumented and unsupported for 5.2 I believe; moved to Collection class for 6.0) and CollClass::maxBlockSize.

Cheers,
John P


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 17 guests