<div dir="ltr">Hi!<div><br></div><div>TL;DR: Would you like to know when any process was started in little cost of memory usage on 32-bit systems and crashdump generation speed?<br><br>Sometimes we have to inspect long-running systems.</div><div>And if a complex enough system runs for a month, it's hard to answer these questions:</div><div> - Process A should run at most 1 hour. Did it stall a week ago?</div><div> - Process B is supervised and it's not good when it restarts. Did it restart last night?</div><div> - Did process C exist when process D was started?</div><div> - Was pid E reused by a new process since it was stored in ETS?</div><div><br></div><div>To answer that questions we need a process start time to be stored somewhere.</div><div>Given that almost every project uses third-party libraries with their own processes, the universal solution could be having process start time available in process_info.</div><div><br></div><div>It turned out that ERTS already have a process start time, used by a crashdump writer.</div><div><br></div><div>I proposed a PR exposing that value in process_info: <a href="https://github.com/erlang/otp/pull/1597">https://github.com/erlang/otp/pull/1597</a></div><div>It's very simple — just return a value we already have.</div><div><br></div><div>But as Rickard Green noticed, it's better to have this time as Erlang monotonic time instead of system seconds in current implementation.</div><div>This will slightly increase memory consumption on 32-bit systems and slightly slow down crashdump generation.</div><div><br></div><div>The other option Rickard proposed is to remove that timestamp completely and save some memory.</div><div><br></div><div><br></div><div>So, the questions are:</div><div><br></div><div> - Do you find process_info(Pid, start_time) useful and worth 4 bytes/process on 32 bit systems?<br> - Do you find process start time in a crashdump useful?</div><div><br></div><div>-- <br><div class="gmail_signature"><div dir="ltr"><div><font face="'courier new', monospace">Danil Zagoskin | <a href="mailto:z@gosk.in" target="_blank">z@gosk.in</a></font></div></div></div></div></div>