Growing image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Growing image

NorbertHartl
Hi,

at the moment I'm developing an application with
seaside, magritte and magma. If I start with a fresh
image I only need a few days for the image to exceed
100MB in total size.

Is there a way do display the total amount of objects
being in the image? I think only a vast amount of
objects could make the image grow that much. A list
of object grouped by class and sorted by amount would
be very helpful.

Is there any such tool?

regards,

Norbert

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: Growing image

Ramon Leon-5
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of Norbert Hartl
> Sent: Tuesday, November 28, 2006 5:03 PM
> To: Squeak Newbies List
> Subject: [Newbies] Growing image
>
> Hi,
>
> at the moment I'm developing an application with seaside,
> magritte and magma. If I start with a fresh image I only need
> a few days for the image to exceed 100MB in total size.
>
> Is there a way do display the total amount of objects being
> in the image? I think only a vast amount of objects could
> make the image grow that much. A list of object grouped by
> class and sorted by amount would be very helpful.
>
> Is there any such tool?
>
> regards,
>
> Norbert

Inspect the result of the following...

(((Object allSubclasses
    reject: [:each | Class allSubclasses includes: each])
        select: [:each | each allInstances size > 100])
            collect: [:each | each name -> each allInstances size])
                asSortedCollection: [:a :b | a value > b value]

It's not fast, but it'll get you what you want.

Ramon Leon
http://onsmalltalk.com 

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Growing image

Klaus D. Witzel
In reply to this post by NorbertHartl
Hi Norbert,

the tool is Smalltalk, just inspect

(((Smalltalk allClasses collect: [:each | each name -> each instanceCount  
])
        reject: [:each | each value = 0])
        asSortedCollection: [:a :b | b value < a value]) asArray

This gives # of objects per class, in a nice GUI :-)

/Klaus

P.S. expect it to run minutes in a large image!

On Wed, 29 Nov 2006 01:02:44 +0100, Norbert Hartl wrote:

> Hi,
>
> at the moment I'm developing an application with
> seaside, magritte and magma. If I start with a fresh
> image I only need a few days for the image to exceed
> 100MB in total size.
>
> Is there a way do display the total amount of objects
> being in the image? I think only a vast amount of
> objects could make the image grow that much. A list
> of object grouped by class and sorted by amount would
> be very helpful.
>
> Is there any such tool?
>
> regards,
>
> Norbert


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Growing image

David T. Lewis
In reply to this post by NorbertHartl
On Wed, Nov 29, 2006 at 01:02:44AM +0100, Norbert Hartl wrote:

> Hi,
>
> at the moment I'm developing an application with
> seaside, magritte and magma. If I start with a fresh
> image I only need a few days for the image to exceed
> 100MB in total size.
>
> Is there a way do display the total amount of objects
> being in the image? I think only a vast amount of
> objects could make the image grow that much. A list
> of object grouped by class and sorted by amount would
> be very helpful.
>
> Is there any such tool?

Some of this may be out of date, but the information here may help:
  http://minnow.cc.gatech.edu/squeak/2176

Also look at class SpaceTally, which is intended for tallying
up object memory usage by classes.

Dave
 
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Re: Growing image

NorbertHartl
In reply to this post by Klaus D. Witzel
On Wed, 2006-11-29 at 01:52 +0100, Klaus D. Witzel wrote:

> Hi Norbert,
>
> the tool is Smalltalk, just inspect
>
> (((Smalltalk allClasses collect: [:each | each name -> each instanceCount  
> ])
> reject: [:each | each value = 0])
> asSortedCollection: [:a :b | b value < a value]) asArray
>
> This gives # of objects per class, in a nice GUI :-)
>
Thanks, this is quite good. I have now a statistic like:

246565 WeakArray
241929 WeakKeyAssociation
179848 ByteString
171165 Array
159003 Association
130254 WeakValueAssociation

What is the best way to determine where this instances are
referenced. Do I have to use PointerFinder or Smalltalk
browseAllObjectReferencesTo: or is there better way?

thanks for your help, this goes also to Ramon and David.
You are very helpful, guys.

Norbert

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Re: Growing image

Klaus D. Witzel
Hi Norbert,

you may want to put one of your app names {seaside. magritte. magma} and  
one of the class names into google search. The search result connects you  
immediately to the collective knowledge of the Squeak community, example:

- http://www.google.com/search?q=weakarray+seaside

Besides of that, you can look for class references and find the guilty who  
send #new or #new: to one of the classes.

/Klaus

On Wed, 29 Nov 2006 13:00:59 +0100, Norbert Hartl <[hidden email]>  
wrote:

> On Wed, 2006-11-29 at 01:52 +0100, Klaus D. Witzel wrote:
>> Hi Norbert,
>>
>> the tool is Smalltalk, just inspect
>>
>> (((Smalltalk allClasses collect: [:each | each name -> each  
>> instanceCount
>> ])
>> reject: [:each | each value = 0])
>> asSortedCollection: [:a :b | b value < a value]) asArray
>>
>> This gives # of objects per class, in a nice GUI :-)
>>
> Thanks, this is quite good. I have now a statistic like:
>
> 246565 WeakArray
> 241929 WeakKeyAssociation
> 179848 ByteString
> 171165 Array
> 159003 Association
> 130254 WeakValueAssociation
>
> What is the best way to determine where this instances are
> referenced. Do I have to use PointerFinder or Smalltalk
> browseAllObjectReferencesTo: or is there better way?
>
> thanks for your help, this goes also to Ramon and David.
> You are very helpful, guys.
>
> Norbert


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Growing image

Ramiro Diaz Trepat
Hello Norbert,
   Have you seen the "Cleaning up junk" swiki page?
   http://minnow.cc.gatech.edu/squeak/2176

   I hope it helps.


   r.

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners