1. Newbie: In memory 4 times bigger?
- Posted by Brent W. Hughes <bwh566 at yahoo.com> Feb 15, 2005
- 495 views
Am I correct in assuming that if a file is 1000 bytes big on disk, that when it is read into memory (with get_bytes()), it will take up 4000 bytes of memory? Brent
2. Re: Newbie: In memory 4 times bigger?
- Posted by Patrick Barnes <mrtrick at gmail.com> Feb 15, 2005
- 509 views
That is true. If you want to do operations on files that may be to large to hold in memory at once, I suggest that you only read into memory the bit that you are working on, and leave the rest of it in the file. For instance, database managers rarely keep the entire database file in memory. They hold the indexes in memory, and use them to figure out where the record they need is in the file, seek() to that point, and just read that into memory. On Mon, 14 Feb 2005 18:26:52 -0800, Brent W. Hughes <guest at rapideuphoria.com> wrote: > > posted by: Brent W. Hughes <bwh566 at yahoo.com> > > Am I correct in assuming that if a file is 1000 bytes big on disk, that when > it is read into memory (with get_bytes()), it will take up 4000 bytes of memory? > > Brent > > > > -- MrTrick
3. Re: Newbie: In memory 4 times bigger?
- Posted by Michael Raley <thinkways at yahoo.com> Feb 15, 2005
- 499 views
Brent W. Hughes wrote: > > Am I correct in assuming that if a file is 1000 bytes big on disk, that when > it is > read into memory (with get_bytes()), it will take up 4000 bytes of memory? > > Brent > if you read it all directly into a sequence yes. You can allocate a memory block to store it, process a porion at a time, or compress the sequence --"ask about our layaway plan". --
4. Re: Newbie: In memory 4 times bigger?
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Feb 15, 2005
- 496 views
On Mon, 14 Feb 2005 18:26:52 -0800, "Brent W. Hughes" <guest at RapidEuphoria.com> wrote: >Am I correct in assuming that if a file is 1000 bytes big on disk, >that when it is read into memory (with get_bytes()), it will take up >4000 bytes of memory? Yes. If you /really/ wanted to, you could quite easily allocate some memory, CreateFile, ReadFile, CloseHandle, and peek and poke at it, or even use file mapping. But don't expect it to be any faster. Perform some experiments on large files (using standard Euphoria methods) before reaching any conclusion, or are you already experiencing a problem? Pete
5. Re: Newbie: In memory 4 times bigger?
- Posted by Brent W. Hughes <bwh566 at yahoo.com> Feb 16, 2005
- 473 views
Pete: No, I'm not experiencing a problem with it. It just caught me a little off guard. I hope I didn't sound like I was complaining. Brent