[Rock-dev] std::bad_alloc: Memory Leak related to typelib/ruby
Alexander Duda
Alexander.Duda at dfki.de
Tue Feb 1 14:53:13 CET 2011
Hi Sylvain,
I think the memory leak I was looking for is related to typelib and the
ruby garbage collector.
The following code let the resources grow from 100 MB to 1GB within 20
sec.
require 'orocos/log'
Orocos::CORBA::max_message_size = 8000000
Orocos.initialize
log_replay = Orocos::Log::Replay.open(ARGV,Typelib::Registry.new)
Orocos.run 'structured_light' do
structured_light = Orocos::TaskContext.get 'structured_light'
log_replay.camera.framepair.connect_to structured_light.frame_pair
structured_light.configure
structured_light.start
log_replay.step
#GC:stress= true
reader = structured_light.structDataImage.reader
0.upto(20000) do
puts reader.read_new
sleep 0.01
end
end
The problem is the function reader.read (reader.read_new). The garbage
collector is somehow not deleting the sample and the result will be
"std::bad_alloc"
If you turn on GC:stress = true everything goes fine.
Alex
--
Dipl.-Ing. Alexander Duda
Unterwasserrobotik
DFKI Bremen
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Phone: +49 (0)421 178-456620
Fax: +49 (0)421 178-454150
E-Mail: alexander.duda at dfki.de
Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/673/0060/3
More information about the Rock-dev
mailing list