Board index » delphi » Memory consumption TStringGrid

Memory consumption TStringGrid

I have a TStringGrid of size 5 columns X 65536 rows.
Only 16 rows are shown at a time. When scrolling to
a new row, the rows, that are not shown any longer,
are cleared (by ...rows[t].clear). New rows are filled in
with values (strings).

When the new values are filled in, memory is allocated,
 but the same amount of memory is not deallocated when
calling clear. This is causing the memory useage to be
intolerable high.

Memory is only beeing allocated the first time a row is
referenced, but given the size of this grid, that is still too
much if the user is scrolling down the hole grid.

Question:
Is there a way to free the memory connected to a row
when it disappear form the visible area?

 

Re:Memory consumption TStringGrid


Odd,

in article <3b2e0d2c$1_2@dnews>, you wrote:

Quote
> Is there a way to free the memory connected to a row
> when it disappear form the visible area?

if you want tight memory usage and don't need editing capabilities, use
TDrawGrid instead. You will be fully responsible for controlling the display.

---
Regards
Ralph (TeamB)
***

Other Threads