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 - Surfaces are not being freed, huge memory leak
Summary: Surfaces are not being freed, huge memory leak
Status: RESOLVED WORKSFORME
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: 1.2.10
Hardware: x86 Windows 7
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-25 07:43 UTC by Cannon
Modified: 2011-12-31 09:33 UTC (History)
0 users

See Also:


Attachments
this conatins the complied binary and the source code (1.98 MB, application/x-zip-compressed)
2010-10-25 07:43 UTC, Cannon
Details

Note You need to log in before you can comment on or make changes to this bug.
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.