Tech Tip: Basic Memory Management Techniques
PRODUCT: 4D | VERSION: 11 | PLATFORM: Mac & Win
Published On: April 23, 2009
Here are some basic techniques a developer should follow in order to help manage memory usage in 4D:
- use CLEAR VARIABLE when done using a variable
- use CLEAR SET when done using a set
- use CLEAR NAMED SELECTION when done using a named selection
- use CLEAR LIST when done using a list
- resize your BLOBs to 0 with SET BLOB SIZE when done using the BLOB or use CLEAR VARIABLE
- resize your arrays to 0 when done using the array or use CLEAR VARIABLE
- don't forget to close any open XML trees such as XML, DOM, SVG, etc (DOM CLOSE XML, SVG_CLEAR)
- if using ODBC always remember to free the connection using ODBC_SQLFreeConnect
- make sure to cleanup any offscreen areas used
See Also:
Commented by Atanas Atanassov on June 2, 2009 at 8:51 AM
How to handle pointers, arrays and pictures is described in technical tip 4597 at http://kb.4d.com/search/assetid=4597