Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in several examples #118

Open
sonicblue7real opened this issue Feb 18, 2024 · 4 comments
Open

Memory leak in several examples #118

sonicblue7real opened this issue Feb 18, 2024 · 4 comments
Labels

Comments

@sonicblue7real
Copy link

sonicblue7real commented Feb 18, 2024

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.

@sonicblue7real
Copy link
Author

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.

@sonicblue7real
Copy link
Author

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.

@sonicblue7real
Copy link
Author

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.

@sonicblue7real
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants