Open sonicblue7real opened 6 months ago
I just discovered something interesting by accident, in the 05_earth example not adding the light_object into the scene but instead using a ambient light:
light2 = Mittsu::AmbientLight.new(0xffffff) ; scene.add(light2)
doesn't result in the same memory leak.
Unfortunately just adding a single obj file to a scene with that ambient light does again result in continuously increasing memory. From the GC.stats
it looks like it's allocating more (total objects) than it's freeing.
Some new information after running more tests and looking at Ruby's memory usage: If even a single sphere is added to a basic scene, the memory issue persists (slowly leaking memory)... however, if I after X minutes remove that sphere from the scene (with scene.remove) the memory leak stops.
So I just discovered that even setting the visibility to false of the object at runtime stops the leak, making it again visible continues to leak memory.
Platform: Linux Ruby version: 3.0.2p107 Mittsu OpenGL Renderer 0.4.0
Running several examples like 02_geometries, 05_earth and 07_earth_normal showcases continuous memory increase.