Find Out What's Running on Dirty Schedulers

I’d be curious if these are related to long lived processes or short lived processes that just keep getting spun up on every request.

The assumption would be it’s a short lived process. If I understand correctly, this is probably happening in the hand off from the middleware to @peixian’s code. That should still be a binary, if so, it may be worth spinning up a proc after the handoff to do the decoding and what ever else is done with it. Since it’ll will be refc bin, the copy to a new proc would be cheap. You might even be able to specify a bigger initial heap to avoid gc. The rationale being that you’re going to need N bytes of memory anyway to deal with your average size payload, so might as well specify that up front and avoid the major gc. The proc then is torn down and should still avoid a gc, I believe, but do please keep me honest here :slight_smile:

If it is short lived, gc is going to get called before the request completes perhaps because not enough was allocated to the proc up front. That is, a refc bin is passed, the bin is decoded, and now the stack and heap meet.

OTOH, if is happening inside a long lived process, well, the above still applies I do believe :slight_smile:

2 Likes