|
Top Previous Next |
Targets: All except BP7
The Memory Report helps you find possible memory leaks in your code.
Sections:
MEMO1-Local objects with unprotected calls to Free MEMO2-Non-local objects with unprotected calls to Free MEMO3-Objects created in try-structure MEMO5-Local objects that are created more than once without being freed in-between
MEMO6-Local objects that are referenced before being created MEMO7-Local objects that are referenced after being freed MEMO8-Created and freed objects
MEMO1-Local objects with unprotected calls to Free
This section reports locations where calls to Free (and FreeAsNil or Release) are not done in try-finally blocks. Failure to wrap a try-finally block around a memory deallocation could result in a memory leak. The report does not list locations in FormDestroy and FormClose events, because these are normally called when a form is destroyed. Neither does it report calls to Free from a finalization block. Also an object that is freed in a try-except block is not reported.
__________________________________________________
MEMO2-Non-local objects with unprotected calls to Free
Like the previous section, but for non-local objects.
__________________________________________________
MEMO3-Objects created in try-structure
This section lists lists locations where an object is created inside a try-structure, like:
Here, Obj should be created before the “try”, otherwise Obj.Free will be called even if the object fails to create, possibly causing a runtime error.
__________________________________________________
This section reports objects that are not created and freed the same number of times. This can indicate an error, like in the following example:
Here, the locally declared object Obj is never freed, so this code will cause a memory leak.
__________________________________________________
MEMO5-Local objects that are created more than once without being freed in-between
This section reports objects that are created more than once (in a row) without being freed in-between. This leads to memory leakage, like in the following example:
Here, the locally declared object Obj is only freed once, which causes a memory leak.
__________________________________________________
MEMO6-Local objects that are referenced before being created
This section reports objects that are referenced before being created. This leads to an exception, like in the following example:
Objects that PAL cannot determine have been created at all, are not reported, only those cases where the object has been created further down in the code. Otherwise there should be many false positives. __________________________________________________
MEMO7-Local objects that are referenced after being freed
This section reports objects that are freed but referenced further down in the code. This leads to an exception, like in the following example:
__________________________________________________
MEMO8-Created and freed objects
This section reports objects and where they are created and freed. Use this for reference and to check that objects are freed.
See also:
|