Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

jscs --auto-configure . process out of memory #1501

Closed
khaledkbadr opened this issue Jun 30, 2015 · 14 comments
Closed

jscs --auto-configure . process out of memory #1501

khaledkbadr opened this issue Jun 30, 2015 · 14 comments
Assignees

Comments

@khaledkbadr
Copy link

When I run jscs --auto-configure . I get
Checking . against the presets
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Aborted (core dumped)

in my 8 GB RAM laptop

@mrjoelkemp
Copy link
Member

Hey @khaledkbadr. Thanks for reporting.

Can you try jscs --max-old-space-size=4096 --auto-configure .? That'll increase node's memory limit from 512mb to 4gb. That should be enough to avoid the error.

@mrjoelkemp
Copy link
Member

See http://stackoverflow.com/a/26094800/700897 for more info.

We haven't had to care much about memory concerns for parsing really big files. An alternative concern could be a memory leak in the auto-config generator, but that's hard to say with just this one reported case.

@chinchang
Copy link

@mrjoelkemp I get an error when using that flag:
error: unknown option '--max-old-space-size'

» jscs --version
1.13.1

@mrjoelkemp
Copy link
Member

Makes sense, but odd that I didn't see that error locally. You could get
around this doing something like node --max-old-space-size=4096
./node_modules/jscs/bin/jscs --auto-configure .

I'm more interested in finding out how to avoid the space issue on the jscs
side. It's hard to dig in without a reproducible scenario though. I'd only
be guessing at possible causes at this point.

Let me know if that works.
On Jul 1, 2015 7:48 AM, "Kushagra Gour" notifications@github.com wrote:

@mrjoelkemp https://github.com/mrjoelkemp I get an error when using
that flag:
error: unknown option--max-old-space-size'`

» jscs --version
1.13.1


Reply to this email directly or view it on GitHub
#1501 (comment)
.

@mikesherov
Copy link
Contributor

@khaledkbadr can you point us to a public repo that this fails on? If we had a repro case, we could debug this much faster.

@mrjoelkemp we may what to try the v8 profiler to see if we can detect a memory leak. tutorial here: https://github.com/felixge/node-memory-leak-tutorial

@khaledkbadr
Copy link
Author

I have a very initial rep that I had the same problem with.
https://github.com/khaledkbadr/token-authentication

Does jscs --auto-configure . ignore the node_modules directory??

@mrjoelkemp
Copy link
Member

It should on the master branch given a recent commit. Can you try the
master branch and see if that helps?
On Jul 1, 2015 9:42 PM, "Khaled Karam" notifications@github.com wrote:

I have a very initial rep that I had the same problem with.
https://github.com/khaledkbadr/token-authentication

Does jscs jscs --auto-configure . ignore the node_modules directory??


Reply to this email directly or view it on GitHub
#1501 (comment)
.

@mrjoelkemp mrjoelkemp self-assigned this Jul 2, 2015
@mrjoelkemp
Copy link
Member

Closing as I think 1ba4b45 fixes the problem. Happy to reopen if that's not the case.

@mikedaly
Copy link

FWIW, commit 1ba4b45 does not address the issue for me. It fails with that error when trying to auto-configure our product's source folder, which does not have node_modules or bower_components (both of which should probably be ignored by default, not just node_modules).

If I start node using the --max-old-space-size=4096 argument as described above, then it does work correctly.

@kirbysayshi
Copy link
Contributor

I'm guessing this is the same issue as #2124. This OOM condition was probably more likely before the automatic exclusion of node_modules in 1ba4b45...

@KeithPepin-MW
Copy link

KeithPepin-MW commented Dec 19, 2016

I was working fine without issue until I added istanbul to my project and jscs began complaining about perceived errors in the ./coverage directory it created. I added "excludeFiles": ["coverage/**"] to my .jscsrc so this would no longer get checked and ran smack into the memory problems mentioned above. Adding the --max-old-space-size=4096 flag mentioned above does not correct the problem for me.

Update: I think once I added the excludeFiles parameter, node_modules and .git folders may have been included again. Adding them to the excludeFiles array of paths fixed the problem for me.

@KeithPepin-MW
Copy link

Any update on this issue? Now seeing problems where jscs simply hangs when running our Travis builds.

@mikedaly
Copy link

You aren't likely to see any updates here, since JSCS is now a deprecated project. The committers have moved over to ESLint and recommended that we do the same.

JSCS — end of the line

@KeithPepin-MW
Copy link

Thanks Mike - I hadn't realized that. I'll make the switch over to eslint.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants