specify error logger for process

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

specify error logger for process

Max Lapshin-2
I've discussed how to store from 100MB to 1GB of data in one process
and found out, that plain array is incredibly faster than ets.
Now I have new problem: sometimes if process crashes, beam.smp takes
all available memory and CPU for error_logger process,
that wants to dump into screen about 450 MB of data, stored in gen_server state.

Either I have to refuse from gen_server, either change way it logs
about error. Have I missed something in documentation or in google?

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: specify error logger for process

Andrew Thompson-2
On Sat, Mar 27, 2010 at 07:42:30PM +0300, Max Lapshin wrote:
> I've discussed how to store from 100MB to 1GB of data in one process
> and found out, that plain array is incredibly faster than ets.
> Now I have new problem: sometimes if process crashes, beam.smp takes
> all available memory and CPU for error_logger process,
> that wants to dump into screen about 450 MB of data, stored in gen_server state.
>
> Either I have to refuse from gen_server, either change way it logs
> about error. Have I missed something in documentation or in google?
>
There's a patch in the OTP 'pu' branch that lets you use the
format_status callback to format the state data passed to the
error_logger. Hopefully it'll make it into the next release.

Andrew

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: specify error logger for process

Max Lapshin-2
> There's a patch in the OTP 'pu' branch that lets you use the
> format_status callback to format the state data passed to the
> error_logger. Hopefully it'll make it into the next release.
>
> Andrew
>

It would be so great to see this feature!

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: specify error logger for process

Max Lapshin-2
At least, I've changed gen_server to gen_server2 and fixed printing of state:

http://github.com/erlyvideo/erlyvideo/commit/b01d15abc3189226dbf824db19db22da35fa33a0#diff-0

Now erlyvideo doesn't hang in error_logger when stream_media dies.

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]