Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations JAE on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA/CATScript memory leak

Status
Not open for further replies.

peter_m

Automotive
Joined
Sep 16, 2016
Messages
4
Location
NL
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:

Code:
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:
task_manager_screenshot_muum5r.png


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

Regards
Peter
 
did you submit to DS as SR ?

Eric N.
indocti discant et ament meminisse periti
 
Just realized I have same problem with one script...

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 [bigsmile]

Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top