[Haskell-cafe] Practical Question: Large memory items
Jules Bean
jules at jellybean.co.uk
Mon Dec 6 10:27:11 EST 2004
On 6 Dec 2004, at 14:55, GoldPython wrote:
> Question: Should the Haskell runtime enviroment provide swapping
> services for large objects?
>
I can't immediately see why the haskell runtime should be able to guess
better than the underlying VM how to handle memory: might as well leave
that to the OS. Unless you're not running on an OS with VM, I
suppose...
If you were really writing an editor in haskell for larger-than-memory
files, I imagine you would have a structure which is
lazily-read-from-disk, so that only actual changes need storing in
memory. Further more at idle time you can write out unsaved changes to
disk (to a temporary file, of course, not the main file) and thus stop
memory usage creeping up. This could all be quite fast and efficient
(perhaps slightly more so if we had an interface to mmap()).
Jules
More information about the Haskell-Cafe
mailing list