A
A
Andrey Grinevich2014-06-19 19:09:52
Node.js
Andrey Grinevich, 2014-06-19 19:09:52

How to reduce memory consumption of node.js?

Good day, I'm expanding my horizons by making a small website for a corporation online;)

The essence of the question is this, there is a server https://github.com/travhimself/evenow/blob/master/...
Which starts eating at startup ~ 39 MB of RAM, and after an hour it reaches 60-70 MB, after a day about 70-75 (no access to the port, just works in the background).

Perhaps there is an opportunity to optimize the code itself or use additional. parameters at startup?
Zy I want to limit consumption to 40-45 megabytes.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-06-19
Protko @Fesor

Memory consumption at startup is normal. In general, the increase in memory consumption in 23 hours from ~65 to ~72.5 megabytes is not very significant. It's like your stats aren't great. Try to drive the application at least somehow for a couple of days, keeping statistics on (normal) memory consumption. There are libraries like memwatch , there are heaps of materials on searching for them. Or maybe the matter is in the garbage collector, which does not want to work out because there is still room to grow.
It's hard to say without some analysis.

H
halfcupgreentea, 2014-06-22
@halfcupgreentea

What version of node is being used? Might be worth the hassle. Another thing may be in the XML parser that works every five minutes, can write a small benchmark for it and drive it?
UPD package.json contains node 0.8.1, current is 0.10.29

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question