We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1070

Summary: Surfaces are not being freed, huge memory leak
Product: SDL_image Reporter: Cannon <cannon>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED WORKSFORME QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 1.2.10   
Hardware: x86   
OS: Windows 7   
Attachments: this conatins the complied binary and the source code

Description Cannon 2010-10-25 07:43:30 UTC
Created attachment 543 [details]
this conatins the complied binary and the source code

we have this program set up where every left click adds a ball and loads an image to the screen, they bounce around etc. 

a right click deletes all the balls, however the memory footprint stays the same
 have attached my project, the file classexamp.exe under Debug\bin should run and the behavior above should exist


we tried many things including explicitly calling the deconstructor and memory still wont fall

the functions that are called to create/destroy are in ball.h/ball.cpp (the Ball class ) 


anything further need please ask
Comment 1 Sam Lantinga 2011-02-17 13:13:58 UTC
That is a pretty cool demo!

How are you detecting the memory usage?  It's possible that the OS is committing memory pages on behalf of your application and then not releasing them even though the memory has actually been freed.

I ran the test here, creating 200 balls and then deleting them, and the allocation counts seem correct:

First start:
Process 22374: 12314 nodes malloced for 9425 KB

After 200 balls created:
Process 22374: 13133 nodes malloced for 10986 KB

After the balls are deleted:
Process 22374: 12303 nodes malloced for 9438 KB

I ran this test on Mac OS X and used the "leaks" tool to detect memory leaks.

Cheers!
Comment 2 Sam Lantinga 2011-12-31 09:33:48 UTC
No response in over a year.