On Fri, 26 Mar 1999, B. Flaumenhaft wrote:
> >On Thu, 25 Mar 1999, Roger Chaplin wrote:
> >
> >> I've written a hack that leaks memory. It uses MemPtrNew to allocate the
> >> memory, but never frees it. I've fixed the memory leak, but I had the
> >> leaky app installed on my PalmIII and consequently leaked quite a bit of
> >> memory.
> >>
> >> My question is: when I delete the offending app, does the OS also find
> >> and free the memory that it had allocated but never freed?
> >
> >That's odd... My recollection is that the OS would automatically free any
> >heap allocations made by a program when that program exits -- there
> >shouldn't be anything left by the time the program is deleted.
>
> This is true for an application, but is it also true for a hack?
Ack, my reading comprehension must be down... No, of course it isn't true
for a hack, as a hack can not allow its memory to be sucked away while it
is running.
No, almost certainly the OS will not find the leaked memory and free it
when you delete the offending hack. There is not (or there didn't use to
be) any label saying which database owned a block of heap memory. (There
is a label saying which running task owns a block of heap memory, which
you can erase to stop the OS from freeing blocks when you exit.)
A warm reset will clear up the heap.
--
Kenneth Albanowski ([EMAIL PROTECTED], CIS: 70705,126)