[erlang-questions] Process heap inspector
Mon Nov 28 16:56:32 CET 2011
On Mon, Nov 28, 2011 at 9:52 AM, Kostis Sagonas <kostis@REDACTED> wrote:
> On 11/28/2011 04:23 PM, Paul Davis wrote:
>> On Mon, Nov 28, 2011 at 7:55 AM, Kostis Sagonas<kostis@REDACTED> wro
>>> I can see that this may be handy to have at some situations, but provided
>>> understand what is happening at the implementation level (disclaimer: I
>>> not looked at the implementation), I think it's actually a pretty bad
>>> to include in a non debug-enabled runtime system.
>>> The reason is that this breaks all assumptions/invariants of the runtime
>>> system in that Erlang processes are independent and can be scheduled to
>>> execute concurrently on an SMP without being preempted by anything other
>>> than exhausting their reduction step count or being stuck on some
>>> With this "built-in feature" processes need to be able to stop at more or
>>> less any random point and stay suspended for an indefinite amount of time
>>> based on code that _another_ process is executing.
>> Bit confused, but wouldn't this objection also apply to
>> erlang:suspend_process/2  as well?
> Right. It would. But I do not remember anybody asking the list before this
> introduced so that I have the chance to voice my opinion.
>> I use this quite often in
>> production on long lived processes that are chewing up resources. Its
>> quite the handy tool in certain cases.
> I very much agree. In fact, I also wrote that it's quite handy to have
> these built-ins as a debugging aid but one should really understand that
> they better not be used outside debugging sessions (note also the warning in
> the documentation ). Personally, I would be reluctant to use them in a
> production system, but then again, perhaps I do not have much experience in
> "real-life" production systems...
>>  http://erlang.org/doc/man/erlang.html#suspend_process-2
Oh I definitely agree that it shouldn't be abused. I had some long
lived non-interactive processes that used to be able to suck up disk
space quite quickly. suspend_process was super handy to put the brakes
on those if I ended up getting too close to the edge of a cliff.
Helped me keep things under control while I rewrote that bit of code.
More information about the erlang-questions