<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Inventor Memory problem (** Impressive and very effective solution **) in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-memory-problem-impressive-and-very-effective-solution/m-p/12333980#M17425</link>
    <description>&lt;P&gt;Thank you. This is helpful!&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 20:39:49 GMT</pubDate>
    <dc:creator>abdullah_elq</dc:creator>
    <dc:date>2023-10-26T20:39:49Z</dc:date>
    <item>
      <title>Inventor Memory problem (** Impressive and very effective solution **)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-memory-problem-impressive-and-very-effective-solution/m-p/12332134#M17424</link>
      <description>&lt;P&gt;After having countless problems with Inventor's memory when carrying out development that processes files in batch mode (Open file, do something and close file)&lt;BR /&gt;It does not free the memory of the objects or files that we open, even if we close them.&lt;BR /&gt;The memory fills up until it throws you out because it has exceeded the memory limit that Inventor could use.&lt;/P&gt;&lt;P&gt;I investigated the forums to see what the Autodesk technicians said and none of the solutions do anything, we still had the problem in Inventor 2024 with the memory issue.&lt;BR /&gt;And I thought... Let's work on the "Inventor.exe" process to see what we can do and... I discovered it... This is the code that I call after closing a file when I am executing code on many files (The more importantly &lt;FONT color="#FF0000"&gt;line 16&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        public static void CierraDocs()
        {
            if(Variables.oApp != null &amp;amp;&amp;amp; Variables.oApp.Documents.Count &amp;gt; 0)
            {
                foreach (Inventor.Document doc in Variables.oApp.Documents)
                {
                    try
                    {
                        doc.ReleaseReference();
                    }
                    catch (Exception)
                    {
                    }
                }
            }
            Process.GetCurrentProcess().MinWorkingSet = Process.GetCurrentProcess().MaxWorkingSet - 1000;
            Variables.oApp.Documents.CloseAll(true);
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And voila... Memory stays below 500,000k at all times.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it can help all of you who have suffered the problem with your developments.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 08:16:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-memory-problem-impressive-and-very-effective-solution/m-p/12332134#M17424</guid>
      <dc:creator>josealberto.torres</dc:creator>
      <dc:date>2023-10-26T08:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Memory problem (** Impressive and very effective solution **)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-memory-problem-impressive-and-very-effective-solution/m-p/12333980#M17425</link>
      <description>&lt;P&gt;Thank you. This is helpful!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 20:39:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-memory-problem-impressive-and-very-effective-solution/m-p/12333980#M17425</guid>
      <dc:creator>abdullah_elq</dc:creator>
      <dc:date>2023-10-26T20:39:49Z</dc:date>
    </item>
  </channel>
</rss>

