[comp.sys.ibm.pc.programmer] Question about Memory Usage

datta@vrdxhq.verdix.com (Diptish Datta) (02/23/90)

I have a TSR that will be invoked by the timer interrupt and at a certain
point in time, it will abort whatever the current process is and punch you
out to DOS. In other words, no matter what you are running, the TSR sits in
the background, and at a certain time kicks you out to DOS. (Why on earth 
would I want to do that? ... that's a whole different story)

Anyway, I'm using DOS interrupt 21h function 4Ch to terminate the current
process. It works fine for most cases. But when I'm running a graphics demo
program (FXSHOW or SOWPARTNER), it will punch me back to DOS ... but after
that I can not run the demo again. Most other programs work. COMMAND.COM
is still working (DOS commands work). But an editer I have also bombs out.

I think that the demo program is allocating memory that is not at its PSP
segment. So, those memory blocks are not getting deallocated.

Question is, is there a way to get a map, at any given time,  
of what memory blocks (segments) are allocated and who (what program) owns 
them?
Then maybe I can free those blocks allocated by my graphics program before
I murder it.

Any suggestions on this would be appreciated.

- Diptish Datta