Skip to content

Commit

Permalink
Ensure GC for # messages threshold only runs if heap used > 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
dipinhora committed May 15, 2019
1 parent fa7d841 commit 0024bcd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libponyrt/actor/actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ static void try_gc(pony_ctx_t* ctx, pony_actor_t* actor)
{
// only run GC is the heap has grow sufficiently
// or if the actor has processed a sufficient number of application messages
// and the actor heap is > 0
if(!ponyint_heap_startgc(&actor->heap)
&& (actor->msgs_since_gc < ACTOR_MSGS_TIL_GC))
&& ((actor->msgs_since_gc < ACTOR_MSGS_TIL_GC) || (actor->heap.used == 0)))
return;

DTRACE1(GC_START, (uintptr_t)ctx->scheduler);
Expand Down

0 comments on commit 0024bcd

Please sign in to comment.