| View previous topic :: View next topic |
| Author |
Message |
anmabagima
Joined: 01 Oct 2009 Posts: 96
|
Posted: Mon Dec 14, 2009 3:59 am Post subject: How to detect memory leaks ? |
|
|
Hi there,
I've set up my own GU homebrew. I tried to clear all instances I've initiated. However, sometimes the PSP crashes where I guess the root cause may be memory leaks. Is there a possability to detect memory leaks ? I'm using minpsp and eclipse as development environment.
Thanks for any hints...
Regards |
|
| Back to top |
|
 |
m0skit0
Joined: 02 Jun 2009 Posts: 226
|
Posted: Mon Dec 14, 2009 4:03 am Post subject: |
|
|
Good programming prevents memory leaks. _________________
| The Incredible Bill Gates wrote: | | The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers. |
|
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Mon Dec 14, 2009 4:10 am Post subject: |
|
|
Memory leaks do not cause program crashes, unless your program comes to the point where it trys to allocate more memory which then fails and your program not handling that case properly.
If you are really concerned about memory leaks, a debug memory manager will help you detect those. One can be found on my devblog, which is an C-Version of the C++ memory manager by Paul Nettle.
Other than that, we cannot help you with your problem, as we don't have enough information. _________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
a_noob
Joined: 17 Sep 2006 Posts: 97 Location: _start: jr 0xDEADBEEF
|
Posted: Mon Dec 14, 2009 4:18 am Post subject: |
|
|
You can also use mmgr to look for memory leaks if you still believe that is the cause. _________________
| Code: | .øOº'ºOø.
'ºOo.oOº' |
|
|
| Back to top |
|
 |
anmabagima
Joined: 01 Oct 2009 Posts: 96
|
Posted: Mon Dec 14, 2009 6:09 am Post subject: |
|
|
| m0skit0 wrote: | | Good programming prevents memory leaks. |
You are absolutely right, but as human's we do make mistakes. And you could even search hours for this one or even get some help of tools, if there are some ;) |
|
| Back to top |
|
 |
anmabagima
Joined: 01 Oct 2009 Posts: 96
|
Posted: Mon Dec 14, 2009 6:11 am Post subject: |
|
|
| Raphael wrote: | Memory leaks do not cause program crashes, unless your program comes to the point where it trys to allocate more memory which then fails and your program not handling that case properly.
If you are really concerned about memory leaks, a debug memory manager will help you detect those. One can be found on my devblog, which is an C-Version of the C++ memory manager by Paul Nettle.
Other than that, we cannot help you with your problem, as we don't have enough information. |
Hi, thanks for that. I will try that out. I'm running my apps on C++. Therefore I would try the original as well ;o)
I'm pretty sure that the reason are memory leaks or in some circumstences wrong calculated needed memory.
Thanks. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Mon Dec 14, 2009 1:47 pm Post subject: |
|
|
| Is there anything like a compile time garbage collection warning system? |
|
| Back to top |
|
 |
a_noob
Joined: 17 Sep 2006 Posts: 97 Location: _start: jr 0xDEADBEEF
|
Posted: Mon Dec 14, 2009 4:45 pm Post subject: |
|
|
It's cool you do not have to listen to me or Raph. We both answered this question. _________________
| Code: | .øOº'ºOø.
'ºOo.oOº' |
|
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Mon Dec 14, 2009 5:52 pm Post subject: |
|
|
| Oh, cool thats exactly what mmgr is. I has no idea. Figured it was some kind of runtime debugging tool (which I normally couldn't be bothered to setup). |
|
| Back to top |
|
 |
a_noob
Joined: 17 Sep 2006 Posts: 97 Location: _start: jr 0xDEADBEEF
|
Posted: Tue Dec 15, 2009 12:58 am Post subject: |
|
|
It has a few functions. But it basically can log every malloc/calloc and it can also catch memory leaks by watching the pointers handed out via these functions. I have not used it in a while, but I think you could alter some of the code,if it doesn't already have callback support, to cause a callback situation to form a sort of error handler to maybe go back and fix the problem, or reallocate the variable with more data. _________________
| Code: | .øOº'ºOø.
'ºOo.oOº' |
|
|
| Back to top |
|
 |
|