Forum: Ruby know can I know how much object has been created???

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
sayoyo S. (Guest)
on 2006-03-31 23:11
(Received via mailing list)
Hi,

We have an application which is very time and ressource consuming, so
we would like to know how to monitoring the number of object created
and the size of memory used by ruby? is there any API that we can use
or where can I find the documentation about this???

Thanks you very much

sayoyo
Gene T. (Guest)
on 2006-03-31 23:29
(Received via mailing list)
removed_email_address@domain.invalid wrote:
> Hi,
>
> We have an application which is very time and ressource consuming, so
> we would like to know how to monitoring the number of object created
> and the size of memory used by ruby? is there any API that we can use
> or where can I find the documentation about this???
>

Not much info to go on, but assuming you've ascertained it's not bound
by network latencies, or web or database server latencies:

Object counts: something like:
c=Hash.new(0); ObjectSpace.each_object {|obj| c[obj.class]+=1}; pp
c.sort_by {|k,v| -v}

http://www.rubygarden.org/ruby?NewProfiler
----------
background info on Memory/ GC:

http://del.icio.us/tag/ruby+gc

http://whytheluckystiff.net/articles/theFullyUptur...

http://www.rubygarden.org/ruby?GCAndMemoryManagement
sayoyo S. (Guest)
on 2006-04-01 00:15
(Received via mailing list)
Thanks you very much for the information:)!!!!

Sayoyo
This topic is locked and can not be replied to.