We had multi-threaded application. Each thread has to invoke with CoIntialize when it is iniatialized as we use some C++ COM object for our DB operation. The application is working fine for longer time in the production env. But suddently the CoIntialize() API in thread init function failed with below error
ThreadInit; HRESULT: 80070008 : Not enough storage is available to process this command.
OS : Windows Server 2003 R2 with SP2. I found work a around in stackoverflow
to increase heapsize for console application from 512 KB to 1MB in windows registry. I can do that. But I want to know what is the possible reason for this to happen first. The env did not changed recently. There are several other process running in that machine they can invoke Coinitialize without any issue. It failed for only two process. Thanks in advance
We had multi-threaded application. Each thread has to invoke with CoIntialize when it is
Share
CoInitialize “initializes the COM library on the current thread”, which does have a memory requirement.
My guess is that your production environment hit a point where the application’s heap size was not adequate to initialize COM on the new thread. Perhaps you hit a scenario where you allocated more threads than previously, even if the application wasn’t running as long.
Raising the heap size would fix this, since it would allow those threads to initialize properly.