[fpc-devel]fcl, classes unit, memory issue

Michael Van Canneyt michael.vancanneyt at wisa.be
Mon Apr 19 11:23:25 CEST 2004

On Sun, 18 Apr 2004, Rimgaudas Laucius wrote:

> Hello,
> uses
>   classes;
> var
>   l: tstringlist;
> begin
>   l.loadfromfile('file.txt'); //<-hangs here
>   ...
> end.
> Program hangs (under windows, 1.9.2 and earlier v.) then i try to load relatively large file (~7 MB) without raising any error message. It works ok, if i set more memory using directive ($M). Why do not program allocate neaded memory automaticaly? Do i need to calculate how much memory need to program and set its size before compilation always?

No. Are you sure it hangs ? My guess is that it is simply working very
hard. It only allocates a 1K buffer to load the file, so that should not
be the issue.


More information about the fpc-devel mailing list