memory leakage problem in erl_format

maruthavanan s maruthavanan_s@REDACTED
Fri May 20 11:29:19 CEST 2005


hi!

I am using erl_interface in windows enviroment with otp R10B-2. i am using 
the following function to send messages from c exe to erlang node.

void send_5to_enode(int e1,int e2,int e3,int e4, int e5)
{
ETERM *t1;
int Result;
HANDLE mutex=NULL;
DWORD result=0;
mutex=CreateMutex(NULL,FALSE,"erlang3");
result=WaitForSingleObject(mutex,INFINITE);
t1=erl_format("{~i,~i,~i,~i,~i}",e1,e2,e3,e4,e5);
Result=erl_reg_send(sockfd, "enodereceiver", t1);
erl_free_compound(t1);
erl_eterm_release();
ReleaseMutex(mutex);
CloseHandle(mutex);
}

If the load is heavy then this function is rapidly called and at certain 
times we get a error saying unhandled exception. Later we debug and found 
that when erl_format is called that internally calls some memory alloc 
function and we get error in this point, also some times we get error 
exception in erl_reg_send(). we used function erl_eterm_statistics() to find 
the allocated and freed memory blocks and some times it shows that allocated 
block as -1.

Anything to be changed on the above code?
Please help.

regards,
Maruthavanan.S

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the erlang-questions mailing list