🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2348

Writing programs that require HEAPS of memory

#2348
From: Richard Frost
Date: Mon, 24 Sep 1990 15:32
41 lines
2570 bytes
I have been asked at work to write a filter program. Unlike most filter
programs this one must load and sort as much data as possible into memory,
and write it out back to disk as another (completely different) file format.

My problem is: 
   
   What algorithms (& data strucures) make good use of the hard disk 
as extra 'memory' when RAM is full.

   I would like one that involves some sort of cache system to minimise
disk access. I would also want one that could be easly fitted into any
data structure that you are using in memory. ie linked lists, trees.
The algorithm must make the accessing of elements of the data structure
in either RAM or disk look indentical (at the function call level).

 
   I have chosen to use dynamically allocated arrays (lots of calls to
realloc()) and to use the array indicies as a general form of 'pointer'
that could be easily used as an index to the records that get 
stored in the file when memory is full.

   This problem MUST hit everyone sometime or another on the IBM. Its
a real shame Uni's don't teach ways of implementing data structures on
low memory systems.. In the _real_ world not everyone has 
virtual memory. B-(. {.. UNIX, I miss you !!!... } 

   Also, I have not seen any books for the IBM that deal with this situation,
could someone please point me to a good book (if any).

Thanks.
--
.---------------.------------------------------.-------------------------.
| Richard Frost | USENET: rfrost@spam.ua.oz.au | FIDONET:  3:680/805     |
.-------.-------^------------------------------^-------------------------|
| O F F | A NEW life awaits you in the OFF WORLD colony, the chance to   |
| WORLD | begin again in a golden land of opportunity and adventure !    |
`-------' New climates, recreational facilities ...                      |
| The custom tailored genetically engineered humanoid replicant designed |
| especially for YOUR needs !!                          .... BLADERUNNER |
`------------------------------------------------------------------------'
Technical Details
Message-ID: <RFROST.90Sep25010254@spam.ua.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!munnari.oz.au!sirius.ucs.adelaide.edu.au!sirius.ua.oz.au!rfrost

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!munnari.oz.au!sirius.ucs.adelaide.edu.au!sirius.ua.oz.au!rfrost
From: rfrost@spam.ua.oz.au (Richard Frost)
Newsgroups: comp.os.msdos.programmer
Subject: Writing programs that require HEAPS of memory
Message-ID: <RFROST.90Sep25010254@spam.ua.oz.au>
Date: 24 Sep 90 15:32:54 GMT
Sender: news@ucs.adelaide.edu.au
Distribution: comp.sys.ibm.pc.programmer
Organization: Dept. of Stats Pure & Appl. Maths, Adelaide University
Lines: 41
Nntp-Posting-Host: spam.ua.oz.au