4Dv18R3 Commands (only the 18 CMDs which can provoke memory leaks)
Friday July 03, 2020 2:28 pmkb.4d.comdoc.4d.com cmd-list-memory-leaks

Memory leaks can occur when a developer uses commands that create a reference in memory, and then forgets to call the appropriate clean-up commands afterwards to delete the reference when it is no longer needed and free up the memory. Below is a table of these commands to keep in mind, paired with the appropriate clean-up command.

Memory leaks could lead to reduction in performance, so make sure each created reference in memory is released when it is no longer necessary.

NameCleanup withTokenIdthreadsafeThemecmdSyntaxcmdDesc
BLOB to listCLEAR LISTC557FalseBLOBBLOB to list ( blob {; offset} ) -> ListRefcreates a new hierarchical list with the data stored within the BLOB blob at the byte offset (starting at zero) specified by offset and returns a List Reference number for that new list.
Copy listCLEAR LISTC626FalseHierarchische ListenCopy list ( list ) -> ListRefduplicates the list whose reference number you pass in list, and returns the list reference number of the new list.
Load listCLEAR LISTC383FalseHierarchische ListenLoad list ( listName ) -> ListRefcreates a new hierarchical list whose contents are copied from the list and whose name you pass in listName.
New listCLEAR LISTC375FalseHierarchische ListenNew list  -> ListRefcreates a new, empty hierarchical list in memory and returns its unique list reference number.
Append documentCLOSE DOCUMENTC265TrueSystem DocumentsAppend document ( document {; fileType} ) -> DocRefopens a document on disk.
Create documentCLOSE DOCUMENTC266TrueSystem DocumentsCreate document ( document {; fileType} ) -> DocRefcreates a new document and returns its document reference number. 
Open documentCLOSE DOCUMENTC264TrueSystem DocumentsOpen document ( document {; fileType}{; mode} ) -> DocRefopens the document whose name or pathname you pass in document.
Open form windowCLOSE WINDOWC675FalseFensterOpen form window ( {aTable ;} formName {; type {; hPos {; vPos {; *}}}} ) -> WinRefopens a new window using the size and resizing properties of the form formName.
Open windowCLOSE WINDOWC153FalseFensterOpen window ( left ; top ; right ; bottom {; type {; title {; controlMenuBox}}} ) -> WinRefopens a new window with the dimensions given by the first four parameters and with the characteristics set using the three following parameters
DOM Create XML RefDOM CLOSE XMLC861TrueXML DOMDOM Create XML Ref ( root {; nameSpace} {; nameSpaceName ; nameSpaceValue} {; nameSpaceName2 ; nameSpaceValue2 ; ... ; nameSpaceNameN ; nameSpaceValueN} ) -> Stringcreates an empty XML tree in memory and returns its reference.
DOM Parse XML sourceDOM CLOSE XMLC719TrueXML DOMDOM Parse XML source ( document {; validation {; dtd | schema}} ) -> Stringparses a document containing an XML structure and returns a reference for this document.
DOM Parse XML variableDOM CLOSE XMLC720TrueXML DOMDOM Parse XML variable ( variable {; validation {; dtd | schema}} ) -> Stringparses a BLOB or Text type variable containing an XML structure and returns a reference for this variable
LDAP LOGINLDAP LOGOUTC1326FalseLDAPLDAP LOGIN ( url ; login ; password {; digest} ) opens a read-only connection to the LDAP server specified in the url parameter with the login and password identifiers provided
QR New offscreen areaQR DELETE OFFSCREEN AREAC735FalseSchnellberichtQR New offscreen area  -> Longintcreates a new Quick Report offscreen area and returns its reference.
Create menuRELEASE MENUC408FalseMenüsCreate menu {( menu )} -> MenuRefcreates a new menu in memory.
SAX OPEN XML ELEMENTSAX CLOSE XML ELEMENTC853TrueXML SAXSAX OPEN XML ELEMENT ( document ; tag {; attribName ; attribValue} {; attribName2 ; attribValue2 ; ... ; attribNameN ; attribValueN} )adds a new element in the XML document referenced by document as well as, optionally, attributes and their values.
SAX OPEN XML ELEMENT ARRAYSSAX CLOSE XML ELEMENTC921TrueXML SAXSAX OPEN XML ELEMENT ARRAYS ( document ; tag {; attribNamesArray ; attribValuesArray} {; attribNamesArray2 ; attribValuesArray2 ; ... ; attribNamesArrayN ; attribValuesArrayN} )used to add a new element in the XML document whose reference is passed in document as well as, optionally, attributes and their values in the form of arrays. 
SVG_NewSVG_CLEARC65999TrueDocumentsSVG_New {( width ; height {; title {; description {; rectangle {; display}}}} )} -> SVG_Refcreates a new SVG document and returns its reference number
CLEAR LISTBLOB to list
Copy list
Load list
New list
C377FalseHierarchische ListenCLEAR LIST ( list {; *} )deletes the hierarchical list whose list reference number you pass in list.
CLOSE DOCUMENTAppend document
Create document
Open document
C267TrueSystem DocumentsCLOSE DOCUMENT ( docRef )closes the document specified by docRef.
CLOSE WINDOWOpen form window
Open window
C154FalseFensterCLOSE WINDOW {( window )}closes the active window opened by the Open window or Open form window command in the current process.
DOM CLOSE XMLDOM Create XML Ref
DOM Parse XML source
DOM Parse XML variable
C722TrueXML DOMDOM CLOSE XML ( elementRef )frees up the memory occupied by the XML object designated by elementRef.
LDAP LOGOUTLDAP LOGINC1327FalseLDAPLDAP LOGOUTcloses the connection with an LDAP server in the current process (if applicable)
QR DELETE OFFSCREEN AREAQR New offscreen areaC754FalseSchnellberichtQR DELETE OFFSCREEN AREA ( area )deletes in memory the Quick Report offscreen area whose reference was passed as parameter.
RELEASE MENUCreate menuC978FalseMenüsRELEASE MENU ( menu )removes the menu whose ID is passed in menu from memory.
SAX CLOSE XML ELEMENTSAX OPEN XML ELEMENT
SAX OPEN XML ELEMENT ARRAYS
C854TrueXML SAXSAX CLOSE XML ELEMENT ( document )writes the statements necessary for closing the last element opened using the SAX OPEN XML ELEMENT command in the XML document referenced by document
SVG_CLEARSVG_NewC65997TrueDocumentsSVG_CLEAR {( svgObject )} frees the memory taken up by the SVG object designated by svgObject