Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Memory Leaks?  (Read 10573 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Memory Leaks?
« Reply #15 on: May 10, 2011, 05:55:05 pm »
Can you upload both projects + sources so that we can look at them?
Laurent Gomila - SFML developer

alphazeeno

  • Newbie
  • *
  • Posts: 14
    • View Profile
Memory Leaks?
« Reply #16 on: May 10, 2011, 06:09:59 pm »
Of course. Here's something else that's even more bizarre.

I just finished adding all the files from my old project to the new one. I set it up so that the new project is now like the old one...

And there is no leak... :|

Anyways, I've attached both solutions.

Proto (old project): http://www.filedropper.com/proto_2

Test (new project): http://www.filedropper.com/test_5

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Memory Leaks?
« Reply #17 on: May 10, 2011, 07:57:30 pm »
In one of them you're not linking to sfml-audio.
Laurent Gomila - SFML developer

alphazeeno

  • Newbie
  • *
  • Posts: 14
    • View Profile
Memory Leaks?
« Reply #18 on: May 10, 2011, 09:19:11 pm »
Right. That addresses why one was using bigger memory, and thanks for pointing it out. :)

But the leak issue is still there...I've been playing with it more, without any conclusive results...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Memory Leaks?
« Reply #19 on: May 10, 2011, 11:36:32 pm »
What happens if you swap the project files? This will show you if the leak is caused by a project flag or by source code.
Laurent Gomila - SFML developer

alphazeeno

  • Newbie
  • *
  • Posts: 14
    • View Profile
Memory Leaks?
« Reply #20 on: May 11, 2011, 12:31:11 am »
Quote from: "Laurent"
What happens if you swap the project files? This will show you if the leak is caused by a project flag or by source code.


What do you mean by swapping the project files? You mean swapping the files between Test and Proto? I'll try that, but I doubt it'd give any result, since the files in Test are copy-pasted from Proto.

Update: I just trying swapping the files from Test to Proto, and it didn't solve the issue.

I'm curious however, did you try running these solutions yourself? If so, did you get the same behavior?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Memory Leaks?
« Reply #21 on: May 11, 2011, 07:56:08 am »
Quote
I'm curious however, did you try running these solutions yourself? If so, did you get the same behavior?

Nop, I don't have Visual Studio 2010.

Quote
Update: I just trying swapping the files from Test to Proto, and it didn't solve the issue.

So the problem is in the source code. Why don't you remove all the files from your project, to keep only main.cpp?

By the way, which is the one that leaks? Test or Proto?
Laurent Gomila - SFML developer

alphazeeno

  • Newbie
  • *
  • Posts: 14
    • View Profile
Memory Leaks?
« Reply #22 on: May 11, 2011, 08:39:56 am »
Quote from: "Laurent"
Quote
I'm curious however, did you try running these solutions yourself? If so, did you get the same behavior?

Nop, I don't have Visual Studio 2010.

Quote
Update: I just trying swapping the files from Test to Proto, and it didn't solve the issue.

So the problem is in the source code. Why don't you remove all the files from your project, to keep only main.cpp?

By the way, which is the one that leaks? Test or Proto?


Proto is the one that leaks. And I did remove all the files from my project, as shown in the screenshot I posted earlier. I made a back up of my project and physically deleted all the files but main.cpp from the project, and the issue persisted.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Memory Leaks?
« Reply #23 on: May 11, 2011, 08:57:58 am »
Ok, so can you upload the project files that contain only main.cpp?

By the way, you don't need to physically delete the files, removing them from the project is enough ;)
Laurent Gomila - SFML developer

alphazeeno

  • Newbie
  • *
  • Posts: 14
    • View Profile
Memory Leaks?
« Reply #24 on: May 11, 2011, 07:18:23 pm »
I know. I just wanted to make sure. :P

Anyways, here's the files of the Proto solution with ONLY the main.cpp. The main.cpp should be identical to the Test solution. Yet this one (Proto with ONLY main.cpp) also shows signs of leaks.

http://www.filedropper.com/protoonlymaincpp

Also, another thing I tested, that might prove useful:

I decided to use VLD (vld.h) to see if it detects any memory leaks or not.

The interesting thing is that VLD said there are no leaks for ANY of the solutions (Proto, Test, and Proto with only main.cpp). And yet the windows Task Manager says otherwise.

Could it be that this issue is just Windows being dumb? Still though, even if that was the case, why wouldn't this happen for the Test Project?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Memory Leaks?
« Reply #25 on: May 11, 2011, 08:50:32 pm »
I think VLD only tracks leaks that happen in your own source (it overloads malloc/free and new/delete -- for what I've seen).
Laurent Gomila - SFML developer

alphazeeno

  • Newbie
  • *
  • Posts: 14
    • View Profile
Memory Leaks?
« Reply #26 on: May 11, 2011, 08:58:26 pm »
Quote from: "Laurent"
I think VLD only tracks leaks that happen in your own source (it overloads malloc/free and new/delete -- for what I've seen).


So does this mean that the issue is not with me own source?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Memory Leaks?
« Reply #27 on: May 11, 2011, 09:50:10 pm »
Quote
So does this mean that the issue is not with me own source?

Most likely.

Quote
Anyways, here's the files of the Proto solution with ONLY the main.cpp

This one still links to sfml-audio.
Laurent Gomila - SFML developer

alphazeeno

  • Newbie
  • *
  • Posts: 14
    • View Profile
Memory Leaks?
« Reply #28 on: May 11, 2011, 10:08:28 pm »
Quote from: "Laurent"
This one still links to sfml-audio.


The Release build shouldn't have that link. The Release build is what I've used for all these solutions, as I had some issues trying to get the debug version of SFML 2.0 to work/compile properly.

 

anything