Memory Commit During Rule (via Resource Monitor) is HUUUUGE

Memory Commit During Rule (via Resource Monitor) is HUUUUGE

MechMachineMan
Advisor Advisor
482 Views
3 Replies
Message 1 of 4

Memory Commit During Rule (via Resource Monitor) is HUUUUGE

MechMachineMan
Advisor
Advisor

I have an iLogic rule that iterates through all of the documents in the open file. It tests a property for a certain criteria, then if it matches that criteria, it adds in to an assembly file that is also created in the macro.

 

The purpose is essentially to put every document into the top level on an assembly so that I can quickly change info through the BOM editor for all levels of files.

 

My computer as 16GB RAM (Low, i know) but when running this rule for an assembly that has ~5000 occurrences and ~1000 documents, it slows down and eventually crashes. I was watching the Resource monitor, and it showed the memory commit getting up to 62 GB for inventor alone.

 

Does this mean that my program has a memory leak, or does it just indicate I need to be releasing my objects (ie each doc) after I use it to place in the assembly? Are there other tricks to manage this issue to make the rules run faster and not use up all of my RAM?

 

Is this issue specific to iLogic? Is vba better for things like this? Should I actually be running this type of program from an external file (like vb.script or excel vba?

 

Thanks in advance,


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
483 Views
3 Replies
Replies (3)
Message 2 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi @MechMachineMan,

 

 

Looks like huge assembly is being dealt. There are few suggestions to improve the performance and listed below.

 

  1. Use hidden mode, users can create an assembly in hidden mode, Documents.Add(kAssemblyDocumentObject, ,False) or Documents.Open(,False). This will make it faster than visible mode.
  2. Save the Assembly after adding a number(e.g. 100) of occurrences and re-open it and continue to place more occurrences. This first can save some job to avoid loss when crash, and also it can help to check where the crash will happen to.
  3. When save the assembly, user can make it visible(using Document.Views.Add), and save the assembly with cached graphics then close it, and then next time open it we can use the Express mode instead of full mode to make it more fast.

Also try the suggestions which are available in Inventor help.

 

http://help.autodesk.com/view/INVNTOR/2014/ENU/?guid=GUID-564D4AF1-E566-490F-9491-BAAFD208F1BC

http://help.autodesk.com/view/INVNTOR/2014/ENU/?guid=GUID-46E714D8-8D90-4D1D-BD6D-8B30ABF78E50

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 4

waynehelley
Collaborator
Collaborator

I have had this issue too where a session of Inventor seems to accumulate memory.  You will probably find that even if you close all documents, Inventor will still keep hold of it.

 

We never found the root cause.  It might be that our own coding was messy and we didn't release objects when we should.  It might just be that the iLogic AddIn doesn't release objects.

 

The only solution we found was to restart the session of Inventor.  Obviously this is a problem when using iLogic and VBA since they are launched from within the session of Inventor but you could create an external .NET addin.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
0 Likes
Message 4 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi @waynehelley,

 

In .Net addins, memory management is well maintained than in VBA and iLogic code. As all objects are released properly in .Net addin, memory leakage issue will not be there.

 

There are some suggestions to improve capacity of system memory. For more details, refer the following link.

 

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2017/ENU/Inventor-Help/files/G...

 

Thanks and regards,

 


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network