The Artima Developer Community
Sponsored Link

Agile Buzz Forum
A thought on memory usage

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
A thought on memory usage Posted: Jan 22, 2005 3:21 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: A thought on memory usage
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

I made a comment in this post's comments about the memory requirements for BottomFeeder. By extension, it was about memory usage in VisualWorks applications in general. With that in mind, let's take a look at that. If I bring up a base VW 7.3 development image, and execute ObjectMemory dynamicallyAllocatedFootprint, I find that I'm using 14 MB of memory. Where is that coming from? There are two places:

  1. Perm Space - all the classes and objects that start off in the image
  2. The rest of the memory spaces:
    1. Eden
    2. SurvivorSpace
    3. LargeSpace
    4. StackSpace
    5. CompiledCodeCache
    6. OldSpaceHeadroom
    7. FixedSpaceHeadroom

You can't do much about perm space without doing a strip (typically with RuntimePackager). The other spaces are well documented in the class side comments of ObjectMemory. You can find out how much space they take up this way: ObjectMemory actualSizes. That will return an array full of numbers, representing the bytes used. In a base (development) image, they look like this:

#(307200 61440 204800 40960 655360 591904 204800)

You can adjust those with the #sizesAtStartup: message - it allows you to send multipliers (x factors) by which to make those bigger. For instance, if you are going to be creating lots of objects quickly, it might make sense to make Eden and the survivor spaces bigger. That's still not a lot of space - at present, BottomFeeder is taking 65 MB on my desktop. Most of that is oldSpace - i.e., objects that have become permenent within the context of the runtime - my feeds, items, etc.

I mentioned that I had preloaded a lot of code - I have. Things like Opentalk, all the network libraries, SOAP, just rafts of stuff. That's something like 16MB of stuff in my base image. Now, I'm not really trying to limit what I load or take stuff out at all - I pretty much just package the image (i.e., make it a runtime) and go. You can do a lot better, and many people do. For instance, Liberty Basic - that's a 3mb download, and it's a Smalltalk application.

Read: A thought on memory usage

Topic: Not just a "pro" problem Previous Topic   Next Topic Topic: Interesting Reader stats

Sponsored Links



Google
  Web Artima.com   

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