NoLeak - include to help you find memory leaks (PB5.20)
- mariosk8s
- Enthusiast
- Posts: 103
- Joined: Wed Apr 06, 2011 11:37 am
- Location: Hüfingen, Germany
- Contact:
Re: NoLeak - include to help you find memory leaks (1.3)
This is a real cool add-in.
Now i only wonder if there's a way to get a call stack of some sort to be included.
That way when an allocate is in a nested function that's called from a lot of different places, we could find out who the evildoer was.
Now i only wonder if there's a way to get a call stack of some sort to be included.
That way when an allocate is in a nested function that's called from a lot of different places, we could find out who the evildoer was.
-
- Enthusiast
- Posts: 792
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
Re: NoLeak - include to help you find memory leaks (1.3)
@luis: Could you please update this to last version?
Thanks.
Thanks.
Re: NoLeak - include to help you find memory leaks (1.3)
Doesn't it work already ? I tried with the last 5.20 beta and unless I'm missing something it does.sec wrote:@luis: Could you please update this to last version?
Only problem I see is in the demo the allocation of 99,999,999,999 bytes does not fail, I seem to recall in older version did so (don't remember which version).
Why does not fail BTW ? I understand the pointer returned is not to physical memory but nevertheless... but maybe what's changed is the underlying OS and not something inside PB ?
Practically allocatememory() never fails today until something horrible happen with the entire OS running out of resources ?
EDIT: now there is something else I don't understand. Currently PB should fill with zeros the allocated memory (by default).
So the OS should be forced not only to "virtually" reserve the memory, but to actually commit it since the memory is actually accessed.
How can the allocation above be successful then ?
EDIT 2: actually it does fail, phew, there was an overflow so the allocated memory was a lot less. I'll change it in the version updated for PB 5.20.
Last edited by luis on Thu Sep 05, 2013 9:24 pm, edited 1 time in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: NoLeak - include to help you find memory leaks (1.3)
@sec
You asked me to update the code to the latest PB version.
I took the time to check it, and I've reported back.
The question I made was not a rhetorical one.
You asked me to update the code to the latest PB version.
I took the time to check it, and I've reported back.
The question I made was not a rhetorical one.
Doesn't it work already ? I tried with the last 5.20 beta and unless I'm missing something it does.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
-
- Enthusiast
- Posts: 792
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
Re: NoLeak - include to help you find memory leaks (1.3)
@luis: I am not expert at hunting the bugs.
I am trying code at your first post with 5.20, it says missing parameters at AllocateMemory, ReAllocateMemory, ...
Thanks
I am trying code at your first post with 5.20, it says missing parameters at AllocateMemory, ReAllocateMemory, ...
Thanks
Re: NoLeak - include to help you find memory leaks (1.3)
Really ? I'll test it again. One of us is probably drunk, mybe I'm the one 

"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: NoLeak - include to help you find memory leaks (1.3)
I just tried, I had the doubt of have used the wrong compiler.
I tried with 5.20 beta 16, x86, under Windows.
It works.
I tried with 5.20 beta 16, x86, under Windows.
It works.

"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
-
- Enthusiast
- Posts: 792
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
Re: NoLeak - include to help you find memory leaks (1.3)
Yesluis wrote:Really ? I'll test it again. One of us is probably drunk, mybe I'm the one

My project has 'refresh' feature', it is increasing 4K after each 'refresh' . bUt i can't find where is root of cause problem.
-
- Enthusiast
- Posts: 792
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
Re: NoLeak - include to help you find memory leaks (1.3)
for example:luis wrote:I just tried, I had the doubt of have used the wrong compiler.
I tried with 5.20 beta 16, x86, under Windows.
It works.
Code: Select all
*Buffer = AllocateMemory(1024, #PB_Memory_NoClear)
Re: NoLeak - include to help you find memory leaks (1.3)
AAAAAH, I think I understand.
You are telling me it doesn't work wit YOUR code, not with MY EXAMPLE.
Right ?
Problem is I was testing what is posted HERE and thought you were doing the same, logically
OK, newer PB versions added a new param to allocatememory and in your code you are using it.
The code need to be updated to work with that, I'll do it as I have a moment, probably this evening.
I'll check the other commands too.
OK ? Bye!
You are telling me it doesn't work wit YOUR code, not with MY EXAMPLE.
Right ?
Problem is I was testing what is posted HERE and thought you were doing the same, logically

OK, newer PB versions added a new param to allocatememory and in your code you are using it.
The code need to be updated to work with that, I'll do it as I have a moment, probably this evening.
I'll check the other commands too.
OK ? Bye!
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
-
- Enthusiast
- Posts: 792
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
Re: NoLeak - include to help you find memory leaks (1.3)
Yes, thanks youluis wrote:AAAAAH, I think I understand.
You are telling me it doesn't work wit YOUR code, not with MY EXAMPLE.
Right ?
Problem is I was testing what is posted HERE and thought you were doing the same, logically![]()
OK, newer PB versions added a new param to allocatememory and in your code you are using it.
The code need to be updated to work with that, I'll do it as I have a moment, probably this evening.
OK ? Bye!

Re: NoLeak - include to help you find memory leaks (1.3)
@sec
Should be ok, give it a try and let me know if I forgot something.
Thanks.
Should be ok, give it a try and let me know if I forgot something.
Thanks.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
-
- Enthusiast
- Posts: 792
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
Re: NoLeak - include to help you find memory leaks (1.3)
I get macro error:luis wrote:@sec
Should be ok, give it a try and let me know if I forgot something.
Thanks.
Code: Select all
Global remote_host_img = _CatchImage (#PB_Compiler_File, #PB_Compiler_Line, 9, ?my_png, $7FFFFFFF)
- mariosk8s
- Enthusiast
- Posts: 103
- Joined: Wed Apr 06, 2011 11:37 am
- Location: Hüfingen, Germany
- Contact:
Re: NoLeak - include to help you find memory leaks (1.3)
Try, checking that you call ClearStructure on all the Structs you free. NoLeak doesn't catch that and it can cause leaks.sec wrote:My project has 'refresh' feature', it is increasing 4K after each 'refresh' . bUt i can't find where is root of cause problem.
-
- Enthusiast
- Posts: 792
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
Re: NoLeak - include to help you find memory leaks (1.3)
@mariosk8s: Thanks,mariosk8s wrote:Try, checking that you call ClearStructure on all the Structs you free. NoLeak doesn't catch that and it can cause leaks.sec wrote:My project has 'refresh' feature', it is increasing 4K after each 'refresh' . bUt i can't find where is root of cause problem.
Never hear about ClearStructure before.
Code: Select all
Threaded NewMap cserver.serverinfo()
ClearMap(cserver()) is equal ClearStructure(@cserver(), serverinfo) ?