The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Re: 18 Million Billion

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Re: 18 Million Billion Posted: Mar 24, 2004 4:38 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Re: 18 Million Billion
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Michael Lucas-Smith

Advertisement

Richard Demers points out that there will be 18 million billion addresses to store objects in to with 64-bit Smalltalk and he ponders the implications of using that much memory and having that many objects.

So I thought it would be fun to find out just how big most objects are in a typical VisualWorks system. Exclusing arrays, all 'data' objects that link to other objects range from having 0 instance variables up to 72 instance variables.

Number of instance variables in a class vs number of classes that have that number of instance variables:

  • 0-5 instance variables: 1852
  • 6-10 instance variables: 5069
  • 11-15 instance variables: 710
  • 16-20 instance variables: 182
  • 21-30 instance variables: 97
  • 31-72 instance variables: 23

Now, just because there are more classes with low numbers of instance variables doesn't mean they're more likely to be instantiated in a system - but, in general principle, on a hunch, I'd say that's very likely to happen. So we're looking at between 0-15 instance variables per object. Lets err towards 10 instance variables, 8 bytes per pointer, so we're using 80 bytes of memory for an object.

Now, for something more gutsy in our system. How many strings do we have and how much space do they take up? Same for arrays:

  • Number of Strings: 111,155
  • Size of Strings: 3,230,686
  • Number of Arrays: 97,460
  • Size of Array (8 bytes per pointer): 746,318 * 8 = 5,970,544
  • Number of OrderedCollections: 4,874
  • Size of OrderedCollection (8 bytes per pointer): 21,667 * 8 = 173,336

I've got no conclusions to make from this, I was just curious about the shape and nature of memory usage in a typical Smalltalk application. And there we have it.

Read: Re: 18 Million Billion

Topic: Still unclear on the concept Previous Topic   Next Topic Topic: Testing with FIT - StS 2004

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use