jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.97k stars 515 forks source link

Memory leaks in version >=3.0.0 #2225

Closed poohitan closed 8 years ago

poohitan commented 8 years ago

It seems that new version of JSCS has some problems with memory consumption.

I can't run JSCS on a file which contains an object with a property which contains a huge string of hardcoded html content.

So the ifle contains some siimple JS code and also something like this:

var obj = { html: '11 thousand of symbols of html...' }

After I run JSCS on this file the node process just starts to consume a lot of memory and become unresponsive. Everything worked well with this file while I was using JSCS v2.11.0.

Also I have to mention that there are a // jscs:disable line in the top of this file, so I wonder while JSCS tries to parse the rest of this file.

markelog commented 8 years ago

I can't run JSCS on a file which contains an object with a property which contains a huge string of hardcoded html content.

Doesn't sound like memory leak to me, it just takes a lot of memory for big file. We can check out some example if you post it somewhere (please not here).

Also I have to mention that there are a // jscs:disable line in the top of this file, so I wonder while JSCS tries to parse the rest of this file.

It finds errors regardless of inline pragmas, just removes it from the error list

poohitan commented 8 years ago

But it worked fast and well with the same file in version 2.11...

Here is sample code: https://gist.github.com/poohitan/2019a10d69140799b8953f79964d1d67

poohitan commented 8 years ago

Can you please let me know, if it is considered as a bug and will be fixed in future? Or is it an expected behaviour? Hope you will consider it as a bug :)

markelog commented 8 years ago

Wouldn't call it as a bug but enhancement, but that would be enhancement on cst side and cst package is fully supported

markelog commented 8 years ago

Replaced with https://github.com/cst/cst/issues/113