[erlang-questions] : Erlang shell crashes

Sean Hinde <>
Sun Oct 29 19:50:06 CET 2006


Hi,

Unfortunately this problem cannot be fixed by switching a magic flag.  
It must be fixed in your application. If you have parts of the system  
producing async messages faster than the process that consumes them  
is scheduled then you *will* run out of memory.

The solution is probably as simple as using gen_server:call instead  
of gen_server:cast.

Sean

On 29 Oct 2006, at 09:38, Surindar Sivanesan wrote:

> I have found that tail recursive function is found in the logwriter  
> process.
> I have fixed that and again ran that application.
> It again crashes after 4 hours.
> Some processes has very high message q length.
> The slogan of crash report is eheap_alloc: Cannot allocate  
> 373664380 bytes of memory (of type "old_heap").
> Is there any settings available to solve this problem?
>
>
>
> On 10/26/06, Raimo Niskanen <raimo+erlang- 
> > wrote: On Thu, Oct 26, 2006 at  
> 02:51:22PM +0530, Surindar Sivanesan wrote:
> > >From the crash dump viewer, I have noticed that the stack+heap  
> size and
> > message queue lenght are high for some processes.
> >
>
> If the message queue length is high for some processes that mostly
> means that they do not read messages as they should. Message queue
> lengths are mostly 1 or 0.
>
> The question is probably: what did they do instead of receive?
> (Fill the heap!?) The stackdump (in the crashdump viewer) may tell.
>
>
>
> >  Pid < http://localhost:8888/cdv_erl/crashdump_viewer/sort_procs? 
> sort=pid>
> > Name/Spawned
> > as<http://localhost:8888/cdv_erl/crashdump_viewer/sort_procs? 
> sort=name_func >
> > State <http://localhost:8888/cdv_erl/crashdump_viewer/sort_procs? 
> sort=state>
> > Reductions< http://localhost:8888/cdv_erl/crashdump_viewer/ 
> sort_procs?sort=reds>
> > Stack+heap<http://localhost:8888/cdv_erl/crashdump_viewer/ 
> sort_procs?sort=mem >
> > *MsgQ
> > Length<http://localhost:8888/cdv_erl/crashdump_viewer/sort_procs? 
> sort=msg_q_len>
> > *
> > < 0.128.0><http://localhost:8888/cdv_erl/crashdump_viewer/ 
> proc_details?pid=<0.128.0>>
> > controling_process Waiting 162446666 10946 380465
> > <0.60.0><http://localhost:8888/cdv_erl/crashdump_viewer/ 
> proc_details?pid=<0.60.0>>
> > logwriter Garbing (limited info) 12549099 93416095 272345
> >
> > Here, the *logwriter* uses ODBC connectivity and write the log to  
> MS SQL DB.
> > All the other process in this application uses *logwriter  
> *process to
> > write log.
> >
> > On 10/26/06, Raimo Niskanen < raimo+erlang- 
> > wrote:
> > >
> > >It seems your application has a process that is growing  
> continously,
> > >and after 15 hours its attemt to allocate a 356 MByte heap failed
> > >due to insufficient memory.
> > >
> > >Your total allocated memory is 1060 MByte of which roughly 356  
> MByte
> > >should be the old heap of the offendng process, leaving 704 MByte
> > >for the rest of the beam emulator. That is also a large emulator.
> > >Is your application deliberately using lots of memory?
> > >
> > >You can use the crashdump_viewer to inspect the crashdump and  
> find out
> > >more about the offending process. You can also use 'top' from  
> another
> > >OS shell while your application runs to verify that the beam
> > >emulator is growing continously and slowly, that being a fatal  
> problem.
> > >
> > >The beam emulator's OS process ID can be found with os:getpid().
> > >
> > >On Thu, Oct 26, 2006 at 11:39:13AM +0530, Surindar Sivanesan wrote:
> > >> Dear all,
> > >>
> > >> I'm using erlang emulator version 5.4.3 for running an  
> application that
> > >has
> > >> to be run round the clock.
> > >> The application has ran perfectly for more than 15 hours.
> > >> Then the erlang shell is terminated abnormally.
> > >> The general information of the crash report is
> > >>
> > >>  Slogan eheap_alloc: Cannot allocate 373664380 bytes of memory  
> (of type
> > >> "heap"). Node name '' Crashdump created on Thu  
> Oct 26
> > >08:48:46
> > >> 2006 System version Erlang (BEAM) emulator version 5.4.3  
> [threads:0]
> > >> Compiled
> > >> Wed Dec 15 12:59:41 2004 Memory allocated 1111921780 bytes  
> Atoms 5644
> > >> Processes
> > >> 716 ETS tables 76 Funs 370
> > >>
> > >> Whether any latest erlang version can solve this problem?
> > >> Is there any settings available to solve this problem?
> > >> I'm running erlang using werl.exe; Whether running erlang using
> > >erl.exewill
> > >> show any difference?
> > >> Please clarify...
> > >> Thanks in advance.
> > >>
> > >> --
> > >> with regards,
> > >> S.Surindar
> > >
> > >> _______________________________________________
> > >> erlang-questions mailing list
> > >> 
> > >> http://www.erlang.org/mailman/listinfo/erlang-questions
> > >
> > >
> > >--
> > >
> > >/ Raimo Niskanen, Erlang/OTP, Ericsson AB
> > >
> >
> >
> >
> > --
> > with regards,
> > S.Surindar
>
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://www.erlang.org/mailman/listinfo/erlang-questions
>
>
> --
>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB
>
>
>
> -- 
> with regards,
> S.Surindar
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list