-
Notifications
You must be signed in to change notification settings - Fork 140
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
Big memory leak problem #129
Comments
Thanks for the simple repro. I haven't done much memory analysis yet and my examples relied on the autorelease pool feature in macOS, which I think is fine to use, but it would be nicer not having to rely on it. Wrapping your main loop or at least all LLGL frame drawing into the following block fixes the problem: while (ProcessEvents())
{
@autoreleasepool
{
/* Frame rendering ... */
}
} ExampleBase does it this way, too, but I am concerned this will always fail on iOS as this platform doesn't support garbage collection iirc. |
Well, with When debugging with Xcode memory leaks faster: about 100 MB in 1 minute |
Did you notice any of such leaks in the examples as well? My activity monitor showed a steady memory usage for the examples. What happens if you wrap the entire main function into the FWIW: There are only a handful of |
If I wrap the entire main function nothing happens,
In the PBR example memory leaks about 0.1 MB in 5–10 seconds. |
I can't think of a tremendous amount of objects being allocated that LLGL wouldn't clean up. Can you test this by replacing the I think the Metal backend should already take care of maintaining the buffer live time during command encoding, so the default I can take a closer look tomorrow. |
Looks like nothing has changed. |
With the example you posted I am having a hard time reproducing a memory leak after adding the |
Unfortunately, my Xcode version doesn't have that feature and my MacBook is too old to upgrade. So I'll have to stick with more oldschool debugging techniques. As I'm testing a bit with explicitly releasing the |
On macOS with the
Metal
renderer, memory leaks every frame.In 3 minutes memory usage of a simple app reached 6 GB.
Minimal repro:
quad.metal:
main.mm:
The text was updated successfully, but these errors were encountered: