delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/18/00:18:37

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Virutal memory problems.
Date: Thu, 17 Oct 1996 22:31:31 -0700
Organization: Three pounds of chaos and a pinch of salt
Lines: 29
Message-ID: <32671633.727A@cs.com>
References: <3266620D DOT 448A AT iamerica DOT net>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp104.cs.com
Mime-Version: 1.0
To: Jon Slaughter <lobo AT iamerica DOT net>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Jon Slaughter wrote:
> 
> I'm working on a small program that loads a elevation map and scales it
> down... original is 18 megs, I have 20. When it gets amost half way it
> starts working the disk and becomes about 10000 times slower :( I'm
> assuming that this is because of virtual memory... but is it supose to
> be this slow. I know I could probably get around this, but I would
> rather know whats going on.

That is indeed a symptom of virtual memory usage.  Does your program
jump around constantly to "random" locations in the structure you use to
store the map?  Virtual memory can be exceedingly slow if you have to
keep paging data in and out to access different portions.

Solutions:
- Reduce the randomness of your algorithm by working on small blocks of
data at a time.
- Divide the file into smaller chunks that do fit in the available
physical memory.
- Remove drivers from memory while running your program, i.e., do a
clean boot or reduce the size of disk caches or ramdisks.
- Install more RAM (cheap at today's prices).

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |        fighteer AT cs DOT com          |
| Proud owner of what might one   |   http://www.cs.com/fighteer    |
| day be a spectacular MUD...     | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------

- Raw text -


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