llewelly <llewelly.at@xmission.dot.com> wrote in message news:<lzisnx65g8.fsf@Britschs-Computer.local.bar>...[color=blue]
>
mango_maniac@yahoo.com (J. Campbell) writes:
>[color=green]
> > Thanks for the advice, guys.
> >
> > Gianni Mariani wrote:
> > "The operating system reclaims all resources used by the process when
> > the
> > process exits."
> >
> > dwrayment wrote:
> > "YES that is a memory leak."
> >
> > E Robert Tisdale wrote:
> > "The operating system reclaims all memory allocated for the process
> > whether the program terminates normally or not."
> >
> >
> > Hmm...do I believe the majority?[/color]
>
> These views are not contradictatory. You do have a memory leak, but
> most evironments will clean up remaining memory leaks (in some
> sense) when a process exits, but I have used a few which did
> not. Your environment's behavior may make this memory leak
> unimportant. Sometimes you will find yourself extending a program
> in a way that makes a previously non-important memory leak
> important. Sometimes you will find it is significantly cheaper to
> let the environment clean up after you. The safe bet is to
> prevent all resource leaks yourself, and not rely on the
> environment to clean them up - unless performance (or development)
> needs dictate otherwise.
>
> Please note the C++ standard says nothing about any of this; either
> kind of environment can host a fully conforming C++
> implementation.
>[/color]
Thanks for the very complete explaination...it helps a lot.
[color=blue][color=green]
> > My real concern was that I was doing
> > some tests where I had created arrays containing 10's of MBs, but
> > "ctrl-break"ed the program, as I was just testing and didn't want to
> > wait for it to finish running. I just wanted to make sure that I
> > wasn't losing resources by doing this.[/color]
>
> I think I have used DOS and windows95 IDEs where this was a problem iff
> the program was launched from the IDE. I do not think it is a
> common problem.
>[/color]
Thanks for the tip
[color=blue]
>
> In any case, memory is not the only resource, and new / malloc are
> not the only ways to acquire memory (though the other ways are
> outside C++). Maybe your OS gives fewer cleanup guarantees for
> other resources.
>
> For the boxen I have around the house, ' periodic reboot ' is about
> once every 3-6 months, and typically caused by a need to move the
> machine beyond its cordage, or install new hardware. So I'm not
> sure why you need to reboot.[/color]
I was actually kinda joking about the reboot biz, as the thread had
already gotten a little OT. My win xp machine almost never crashes,
although I do turn it off most nights. However, applications, eg my
compiler crashes pretty regularly...no fault of the OS. I do like NT
(oops...i mean xp) compared to 3.11, 95, 98 that I used before. NT 4
was good too...I haven't really had stability problems since win 95
(before the service release)...
Anyway...thanks again. My take-home message is that if ctrl-breaking
out of progs I'm writing, perhaps it's better to access the console
from *outside* the IDE interface, as doing so from within may
(shall??) cause a memory leak...and subsequent crash (bloodshed indeed
*did* crash on me twice today while working with progs that had circa
11 MB in memory...and I was breaking out of them from the IDE!!) That
was why I posted in the first place.
Thanks guys...I think I understand this issue...now for multiple
inheritance...maybe next week.