Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Update:</strong>, In answer to the OP's question, class <code>System.GC</code> has a method for getting an estimate of the amount of memory in use:</p> <pre><code>System.GC.GetTotalMemory(false) </code></pre> <p>If you are using COM on a long-running process (i.e. no idle time) then you <em>will</em> experience a memory leak unless you periodically call:</p> <pre><code>Thread.CurrentThread.Join(100); </code></pre> <p>The <code>100</code> can of course be changed, but will be how long your active thread "sleeps" before resuming. From the docs:</p> <blockquote> <p>Blocks the calling thread until a thread terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping.</p> </blockquote> <p>It is that last clause that is key.</p> <p>Reference: <a href="http://support.microsoft.com/kb/828988" rel="nofollow">http://support.microsoft.com/kb/828988</a></p> <blockquote> <p>If a console application that is based on a single-threaded apartment (STA) creates and then uses STA Component Object Model (COM) components and the console application does not perform sufficient operations to pump COM messages, such as calling the Monitor.Enter method, the Thread.Join method, and others, the following symptoms may occur. Also, if the console application performs operations that that run for a long time and that do not pump messages, such as calling the Console.ReadLine method, the following symptoms may occur:</p> <ul> <li>The release of COM components may be delayed.</li> <li>The calls to the Finalize methods of the objects that the garbage collector collects may be delayed.</li> <li>Calls to COM components may block the application thread for extended periods. <strong>The memory amount that the STA application process uses may increase over time.</strong></li> <li>Calls to the GC.WaitForPendingFinalizers method may take a long time to return.</li> </ul> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload