Mail Archives: djgpp/1996/10/18/00:18:37
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 -