[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory problem when running a DLL



PureBytes Links

Trading Reference Links

> Any ideas why an indicator using a dll would crash TS after being
> applied to a chart 3 times?  The error message is: "error: out of
> memory".  

My first guess would be that you're out of memory.  :-)  Maybe your 
DLL has a memory leak somewhere -- allocating something when it 
enters, not deallocating it before it exits, and not keeping a 
pointer to it anywhere.  Do that on a few thousand bars and you can 
chew through a lot of memory.

Or maybe your DLL uses some kind of static memory -- global or static 
variables -- that are *shared* between all invocations, and you're 
not sharing them properly.  E.g. maybe you allocate memory with a 
pointer to it in global memory.  Then when the 2nd or 3rd instance of 
the DLL starts up, they don't check to see if the memory is already 
allocated, and overwrite the pointer in the global var when they 
allocate a new set of memory.

> Can it be due to not using any of the Dll_Add, Dll_Context, and
> Dll_Free functions? 

I'm not familiar with those.  Are those for TS2k?
Gary