title: Delphi EOutOfResources (GDIError)
body: <p>I have written an application in which I find ocasionally EOutofResources errors
  raised by GDIError method of Graphics unit when saving TBitmap32 to a stream.</p>
  
  <p>As far as I know it can come from gdi limits or heap limits.
  i know that for the process there is a default limit of 10000 handles. 
  So my application according to the task manager reports only 620.</p>
  
  <p>I have downloaded and run Desktop Heap Information Monitor Tool which reported this:</p>
  
  <pre><code>Desktop Heap Information Monitor Tool (Version 8.1.2925.0)
  Copyright (c) Microsoft Corporation.  All rights reserved.
  -------------------------------------------------------------
    Session ID:    0 Total Desktop: (  7360 KB -   11 desktops)
  
    WinStation\Desktop            Heap Size(KB)    Used Rate(%)
  -------------------------------------------------------------
    WinSta0\Default                    3072             44.5
    WinSta0\Disconnect                   64              4.5
    WinSta0\Winlogon                    128             10.2
    Service-0x0-3e7$\Default            512             29.1
    Service-0x0-3e4$\Default            512              6.8
    Service-0x0-3e5$\Default            512              6.8
    SAWinSta\SADesktop                  512              0.5
    __X78B95_89_IW\__A8D9S1_42_ID       512              0.5
    Service-0x0-1ae39$\Default          512              2.4
    Service-0x0-12d284a7$\Default       512              2.5
    Service-0x0-1312b6d4$\Default       512             15.0
  -------------------------------------------------------------
  </code></pre>
  
  <p>As above I have used only 44% of the desktop heap in winsta0.</p>
  
  <p>Besides this error is raised from time to time. it never reaches mentioned limits.
  How can i check where the problem is? What causes raising this error?</p>
  
  <p>Thanks</p>