How detect memory leak / overflow

DOS specific questions.
Post Reply
Cpcdos
Posts: 207
Joined: Mar 06, 2013 13:52
Location: France - LYON 69003
Contact:

How detect memory leak / overflow

Post by Cpcdos »

Hi everyone! :)
I want know how detect a memory leak/overflow from my dos executable compiled wih freebasic ? (eventually with -g)

GDB tool for DOS does not this :(

Regards!
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: How detect memory leak / overflow

Post by grindstone »

Hello Cpcdos!

Put the statement FRE into your program at an appropriate place, let the program run and watch the value. If it becomes less and less and less... you probably got a memory leak.
Cpcdos
Posts: 207
Joined: Mar 06, 2013 13:52
Location: France - LYON 69003
Contact:

Re: How detect memory leak / overflow

Post by Cpcdos »

Hello grindstone!

Thank you for your reply, under freedos, the FRE value never goes back, like if FRE can't see the "deallocated memory" :(

I can block any irq, and use malloc in loop until saturation, and get number bytes used and freeing this.

So apparently, he does not exist a tool for FreeBasic (DOS) ?

Regards
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: How detect memory leak / overflow

Post by grindstone »

Hm... Maybe you could try to call the freedos - statement MEM via the FB - SHELL - command? Only a suggestion. No clue if it works.
Cpcdos
Posts: 207
Joined: Mar 06, 2013 13:52
Location: France - LYON 69003
Contact:

Re: How detect memory leak / overflow

Post by Cpcdos »

Hmm.. MEM He can't detect DPMI memory :/ Never mind

But thank you for your help :)
Post Reply