10
\$\begingroup\$

I have a JavaScript program (Node.js), which is working 100% fine, however recently I realized it is leaking memory, most likely from several different areas, likely due to closure pattern, and exacerbated by Promise library to handle async stuff. So it can benefit highly from some code review.

I know buggy code is off topic in this site -- are leaks falling under bugs for that classification? Only reason I am not sure is the program working 100% as expected (up until point where memory gets exhausted). I know closure pattern is common source of leak for JS so I figured there maybe a lot of knowledge here (rather than S.O. which maybe geared more toward 'just make it work')

\$\endgroup\$
1
  • 2
    \$\begingroup\$ I'm certain this would be on topic for Stack Overflow, although you tend to get more attention here. \$\endgroup\$
    – Veedrac
    Dec 20, 2014 at 5:37

1 Answer 1

9
\$\begingroup\$

I believe similar questions have been asked before: a search.

Your question should be fine. There are a number of issues commonly related to coding, like performance, where "works" is a grey area. We try to be reasonably generous with the definition of working code.

Your code, by the sounds of it, does the intended job.

I recommend asking the question. Note that (many) other facets of your code may be reviewed as well as (or perhaps instead of), your primary memory-leak concerns.

\$\endgroup\$
1
  • \$\begingroup\$ Heh..I thought to check Meta for the rules but not look if in the wild any examples... thank you, I will suitabilize the code and make a post \$\endgroup\$
    – aarosil
    Dec 16, 2014 at 6:00

Not the answer you're looking for? Browse other questions tagged .