VBA/CATScript memory leak
VBA/CATScript memory leak
(OP)
Hello Everyone
I have read that memory leak when running scripts in Catia is a "feature", but until now I didn't realize that it leaks like a sieve. Or maybe I'm doing something wrong.
I wrote a simple script to test this:
Below screens from task manager before running script, after first run and the second:

CATDUA shows no errors, garbage collector should clean oDocument and oPoint at the end of the script, so where is the problem?
Regards
Peter
I have read that memory leak when running scripts in Catia is a "feature", but until now I didn't realize that it leaks like a sieve. Or maybe I'm doing something wrong.
I wrote a simple script to test this:
CODE --> VBA
Sub CATMain()
Dim oDocument As PartDocument
Dim oPoint As HybridShapePointCoord
Set oDocument = CATIA.ActiveDocument
For i=0 To 10000
Set oPoint = oDocument.Part.HybridShapeFactory.AddNewPointCoord(0, 0, 0)
oDocument.Part.HybridShapeFactory.DeleteObjectForDatum oPoint
Next
End Sub Below screens from task manager before running script, after first run and the second:

CATDUA shows no errors, garbage collector should clean oDocument and oPoint at the end of the script, so where is the problem?
Regards
Peter





RE: VBA/CATScript memory leak
indocti discant et ament meminisse periti
RE: VBA/CATScript memory leak
RE: VBA/CATScript memory leak
I'll put a counter as global parameter (so it will stay in CATIA Session) and remind user to close session if counter reach some TBD value...if user keep working with leaking script I'll change background color to RED. Final step the script will simply close catia and wish user good night!
Who said scripting was not fun
indocti discant et ament meminisse periti
RE: VBA/CATScript memory leak
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU