Hi all,

Ruby 2.1+ allows tracing object allocations, see more details in this article 
[1].

I enabled it and dumped the Ruby memory usage data in a SLES12-SP2 Beta3 
installation.

It is related to this Trello card [2] and this bug [3].

You can find more details and the dump in my Gist [4], here is a copy of the 
most
interesting part:



## The Result

A quick scan found out that the place which consumes most memory is

  /usr/share/YaST2/lib/installation/ssh_config_file.rb:45:STRING: count: 4,
  total size: 274056

which loads the SSH keys and configuration from the previous installation and 
needs
about 270kB memory.

The question is we can optimize it better, the SSH keys actually need to be 
stored
somewhere as the target partition will be reformatted...

The only optimization could be probably possible when the user selects to not 
copy
the keys. In that case we could drop the loaded keys when the installation 
starts.
But that's not the default so this improvement would actually help only in some 
cases...

## TODO

You can collect a different statistics from the data, e.g. the place which 
creates
the most objects, which methods, check the object "age" (the GC generation 
value), etc...



[1] http://tmm1.net/ruby21-objspace/
[2] https://trello.com/c/QJ2PHxjs
[3] https://bugzilla.suse.com/show_bug.cgi?id=974601
[4] https://gist.github.com/lslezak/6b99026b7ea9e163cdfd5a6d6d0aca6c


--

Best Regards

Ladislav Slezák
Yast Developer
------------------------------------------------------------------------
SUSE LINUX, s.r.o.                              e-mail: [email protected]
Lihovarská 1060/12                              tel: +420 284 028 960
190 00 Prague 9                                 fax: +420 284 028 951
Czech Republic                                  http://www.suse.cz/
-- 
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to