How detect memory leak / overflow

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

How detect memory leak / overflow

Postby Cpcdos » Jan 12, 2017 11:04

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: 343
Joined: May 05, 2015 5:35
Location: Germany

Re: How detect memory leak / overflow

Postby grindstone » Jan 12, 2017 11:35

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: 192
Joined: Mar 06, 2013 13:52
Location: France - LYON 69003
Contact:

Re: How detect memory leak / overflow

Postby Cpcdos » Jan 13, 2017 8:21

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: 343
Joined: May 05, 2015 5:35
Location: Germany

Re: How detect memory leak / overflow

Postby grindstone » Jan 13, 2017 8:48

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: 192
Joined: Mar 06, 2013 13:52
Location: France - LYON 69003
Contact:

Re: How detect memory leak / overflow

Postby Cpcdos » Feb 18, 2017 10:11

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

But thank you for your help :)

Return to “DOS”

Who is online

Users browsing this forum: No registered users and 2 guests