Please help with 4007: ERR_NO_MEMORY_FOR_TEMP_STRING no memory for temp string

 

Hello all. I have a very sticky issue for which I cannot find any solution and would very much appreciate any pointers or ideas.

My EA is gernerating the error 4007 no memory for temp string.

Has anyone else ever run against this?

I build strings to add to a log, but truncate to 248 bytes before calling my LogMessage(string message) or any other function. (This was an attemt to make the error go away.)

I build the strings using ...

string ls_Message = "";

ls_Message = ls_Message + " some additional info.";

I write strings to files using FileWrite(_FileHeaderHandle, ls_Message);

The error does no show up at the same location in the EA, and causes memory leaks which eventually cause MT4 to act very strangely(Can't save reports, just does not respond, etc.)

Any ideas where to look, have you ever had this happen and solved it?

I am not using external dlls, but do have an .ex4 library with common functions that are called.

Thany you for any help or ideas you may have.