[fpc-pascal] Caching a big file on memory

Leonardo M. Ram� martinrame at yahoo.com
Mon Sep 11 19:54:29 CEST 2006

I don't tested this with large files, but why don't you use TMemoryStream:

  myFile: TMemoryStream;

  myFile := TMemoryStream.Create;

--- Eduardo <nec556 at retena.com> wrote:

> Hello:
> 	I have a little problem, i participe in the 'Large Compression 
> Benchmark' (http://cs.fit.edu/~mmahoney/compression/text.html) and 
> need to cache the whole enwik8 file (100MB) on memory but when i try 
> to  allocate space for it i get a compiler error, saying that maximum 
> is 64MB (67108864). I tried to use $MEMORY 200000000,500000000 (200MB 
> stack and 500MB heap) and the compiler switches, but no success.
> 	I need all the file on RAM beacause i want to do a BWT, which 
> implies a sort of the 100MB and uses 400 more MB, and doing so from 
> hard disk is very slow. The contest has a time limit of 10 hours on a 
> 1Ghz machine, but i need all speed at BWT/sort phase, so i can spend 
> the time on getting better compression.
> 	Must i touch the system, rtl etc... files and recompile compiler? Or 
> is there another, and simpler, way?
> P.D. Of course, my pc has more than 100 MB (1.25 GB)
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Leonardo M. Ramé

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the fpc-pascal mailing list