R
Ram P. Dash
Hi:
I've a third party DLL (not a .NET class library PE) which I use using
DllImport attribute in my application running in multiple threads invoking
different methods of the same DLL.
The memory usage of the application is shooting to 1GB in just 30 minutes.
It goes till it's 1.4GB after which I get OutOfMEmory exceptions. If I don't
use the DLL, my memory stays put at 100MB.
I tried freeing the DLL using FreeLibrary but after few seconds I am getting
"Object reference not set to an instance of an object" while accessing the
methods of the DLL.
How can I ensure that only one copy of the DLL per thread is in my
application memory and that the DLL is unloaded when it's no longer used by
any of the threads?
BTW, my application is an ASP.NET web service but this has nothing to do
with the statelessness of a webmethod because I am spawning and running the
threads in the background at application level.
Thanks,
Ram
I've a third party DLL (not a .NET class library PE) which I use using
DllImport attribute in my application running in multiple threads invoking
different methods of the same DLL.
The memory usage of the application is shooting to 1GB in just 30 minutes.
It goes till it's 1.4GB after which I get OutOfMEmory exceptions. If I don't
use the DLL, my memory stays put at 100MB.
I tried freeing the DLL using FreeLibrary but after few seconds I am getting
"Object reference not set to an instance of an object" while accessing the
methods of the DLL.
How can I ensure that only one copy of the DLL per thread is in my
application memory and that the DLL is unloaded when it's no longer used by
any of the threads?
BTW, my application is an ASP.NET web service but this has nothing to do
with the statelessness of a webmethod because I am spawning and running the
threads in the background at application level.
Thanks,
Ram