Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory consumed when using GRID (VFP6 SP3)
Message
From
11/04/2000 03:16:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/04/2000 19:12:27
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00357734
Message ID:
00357845
Views:
13
>In a custom GRID class I have code that changes the colour of the grid depending on the deleted status of the record and also highlights the current record. This is achieved using setall dynamicbackcolor command in the grid refresh method:
>
>
>thisform.nCurRec=recno(this.recordsource)
>
>this.SetAll("dynamicbackcolor",;
>   "iif(recno() = thisform.nCurRec, ;
>       iif(dele(),RGB(192,192,128),this.rowHighlightColor), ;
>       iif(dele(),RGB(197,165,173),RGB(255,255,255)))", ;
>    "Column")
>
>
>When a form with a grid based on this class is active for a long time, it becomes apparent that RAM is being progressively consumed until it exhausts the physical RAM and starts disk swapping. I checked this by adding a textbox that displays the value of sys(1016) as the grid is refreshed, and watched the unused physical memory in the Windows System Monitor.
>
>Removing the grid coloring code resolves the problem. Anyone know why this is happenning.


Sam,
Just move the code to init. It's unnecessary to call a function to set a property n times. That's the reason for extra consume. Also as I see rowHighLightColor I can say already your grid is subclassed. So good :) Move custom nCurrec property from form to grid which would make your grid class form independent.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform