[Glass] Get list of class with most instances and size

Johan Brichau via Glass glass at lists.gemtalksystems.com
Thu Jul 2 01:48:11 PDT 2015


Hi Mariano,

The following piece of code gives you the list of classes loaded into gem memory with their number of instances (and sorted on most instances first). 
Don’t search for a meaning, the ' _vmInstanceCounts: 2 ‘ is something I got from Dale :)

instanceCounts := (System _vmInstanceCounts: 2) sorted:[:a :b | b value first <= a value first].

cheers
Johan

> On 02 Jul 2015, at 06:59, Mariano Martinez Peck via Glass <glass at lists.gemtalksystems.com> wrote:
> 
> 
> 
> On Thu, Jul 2, 2015 at 1:20 AM, James Foster <james.foster at gemtalksystems.com <mailto:james.foster at gemtalksystems.com>> wrote:
> ScanBackup gives a report of all the objects in the on-disk repository while an out-of-memory error gives a report of all the objects in the Gem (an individual VM session that has a subset of the repository in RAM). 
> 
> 
> Ohhh good difference!
> So....OK, I will wait to see if that URL has latest ScanBackup.
> And do you know where I can get the one of the gem? 
> 
> 
>  
> James
> 
>> On Jul 1, 2015, at 6:19 PM, Mariano Martinez Peck via Glass <glass at lists.gemtalksystems.com <mailto:glass at lists.gemtalksystems.com>> wrote:
>> 
>> Dale, 
>> 
>> Is this https://programminggems.wordpress.com/2009/05/14/scanbackup/ <https://programminggems.wordpress.com/2009/05/14/scanbackup/>  still the last available code to get that? I think it is not, because sometimes when I get a gem crash with an out of memory I get that table written into the log, therefore, I should have such code somewhere in my gemstone. But I do not have ScanBackup class.
>> 
>> So...yes, I want to print a little table with the classes with most instances, and hopefully the size and occupied memory (SpaceTally in Pharo).
>> 
>> Best, 
>> 
>> -- 
>> Mariano
>> http://marianopeck.wordpress.com <http://marianopeck.wordpress.com/>
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com <mailto:Glass at lists.gemtalksystems.com>
>> http://lists.gemtalksystems.com/mailman/listinfo/glass <http://lists.gemtalksystems.com/mailman/listinfo/glass>
> 
> 
> 
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com <http://marianopeck.wordpress.com/>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com <mailto:Glass at lists.gemtalksystems.com>
> http://lists.gemtalksystems.com/mailman/listinfo/glass <http://lists.gemtalksystems.com/mailman/listinfo/glass>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20150702/df145d42/attachment.html>


More information about the Glass mailing list