@SahilExec Maybe the 3rd party HTML parsing library we were using was attaching gigantic properties to the strings it was returning? I have no idea.
I left the magic line in there along with a giant block comment explaining why it's there and warning to never remove it.
So odd.
@SahilExec On a whim, I changed the last line of getMetadata() to:
return JSON.parse(JSON.stringify(results))
Now the feature is actually working and there is no memory leak.
@sappiencer@staranchenko_cy@crunchydata A similar thing happens with upsert operations (insert into…on conflict…). We learned this the hard way in a previous company. A table’s serial (note: not bigserial) primary key hit (2^31)-1 but the table only had a few million rows.