Hacker News new | ask | show | jobs
by keitmo 2274 days ago
A few years ago we had a nightmarish resource leak in our server. The code in question was reading and parsing HTML, looking for a handful of specific tags (title, description, etc). Under heavy load the server would be stable for a few hours, then memory would suddenly explode and kill the NodeJS process.

The problem was caused by the HTML parser we were using. The parsing results appeared to be a POJO but apparently there was much lurking under the surface.

The fix: `parseResults = JSON.parse(JSON.stringify(parsedResults))`

1 comments

Which library was that?