Size restrictions of TStringGrid lazarus / 31-LCL ---------------------------------------------------------------------- jwdietrich · 2011-09-22 13:35 What is the maximum allowed size of a StringGrid? I didn't find any information in the wiki. Are there any boundaries with respect to col count or row count, and what are the limits with respect to memory occupation? Does this differ on different widgetsets (Carbon, GTK, Windows)? ---------------------------------------------------------------------- User137 · 2011-09-22 15:55 Sounds complicated to calculate. If each row has its own TStringGrid, how much does one take memory even if Text property isn't count? The count goes to max integer by default maybe, but in reality that might hog roughly 10 Terabytes of memory, or i don't know. (assuming it's 1 column and high(integer) rows) ---------------------------------------------------------------------- jwdietrich · 2011-09-22 16:37 That's the reason why I ask. Is memory allocated dynamically and only limited by the system's memory or are there any "hardcoded" boundaries, e.g. set by fixed datatype sizes or by a maximum number of rows and/or columns? ---------------------------------------------------------------------- Blaazen · 2011-09-22 21:26 Cols and Rows are indexed with signed integer, so theoretical limit is ~2'100'000'000. And yes, memory is allocated dynamicly (for example when you increase RowCount property), so limit is your system memory. See "Grids.pas". ---------------------------------------------------------------------- jwdietrich · 2011-09-22 22:01 OK, that sounds good. Thank you for the fast reply! My application (see http://simthyr.sf.net, should you be interested) crashes when the grid is filled with a certain amount of data, but this may come from the operating system. This hypothesis is supported by the fact that the time when the application crashes is dependent from the widgetset (about 3 days of simulated time on Windows, one day on Linux and two weeks on Mac OS X). I fear that I have to empirically determine the maximum size and then to taper out the values that are written into the grid according to the ratio of available data and maximum grid capacity. Thanks again! ---------------------------------------------------------------------- User137 · 2011-09-22 22:39 You would be better off having only window size grid and making manual scrollbar for data. You would have only numeric valuables in memory and it'd be 100 times faster and more memory efficient. ---------------------------------------------------------------------- jwdietrich · 2011-09-23 13:59 Thank you, I will consider this option. ---------------------------------------------------------------------- mas steindorff · 2011-09-23 17:50 At one tine I was using TString's loadfromfile and SaveToFile and hit a limit at 1 or 2G files (can't recall the size at the moment).  The TString(list) still works OK for storage but I had to go to a line by line write/read operation to overcome the limit of it's file I/O.