delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/06/16:25:23

From: Paul Richards <Paul AT dunvegan1 DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Dynamic memory allocation
Date: Thu, 6 May 1999 12:07:39 +0100
Organization: Paul's house
Message-ID: <nuG6vBA7fXM3EwSv@dunvegan1.demon.co.uk>
NNTP-Posting-Host: dunvegan1.demon.co.uk
X-NNTP-Posting-Host: dunvegan1.demon.co.uk:193.237.111.243
X-Trace: news.demon.co.uk 925991726 nnrp-11:28549 NO-IDENT dunvegan1.demon.co.uk:193.237.111.243
X-Complaints-To: abuse AT demon DOT net
MIME-Version: 1.0
X-Newsreader: Turnpike (32) Version 4.01 <5Y9PmoTxnkdx6tAFcQ+gcCx86I>
Lines: 26
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,
I just got to the bit in my book about Dynamic memory allocation so in
my quest to break stuff I wrote this:

#include <iostream.h>

int main(void)
{
 for (;;)
  new double;
}

I know you're all jealous!!

I was gonna see what happens to memory that doesn't get freed and also
what happens when you run out.  Well when I run it there is a long
stretch of thrashing the HD (making swapfile?) and then it says "ran out
of virtual memory for 'new'" or something similar.  The program stops
after that message but what happened to all the memory that I allocated?
Is it still allocated and Win95 has just paged it into the swapfile?
-- 
Paul Richards (AKA Pauldoo)
EMAIL   paul AT dunvegan1 DOT demon DOT co DOT uk
FAX     +44 (0)870 0522086
HTTP    www.dunvegan1.demon.co.uk/paul/
ICQ     14106503

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019