file too large for eclipse - eclipse

So... I was generating queries and then I pastes one particularly long one into eclipse, eclipse encountered a heap error and then crashed. I thought, no big deal, I can just go back in and delete a bunch, except for... every time I try to look at the file now eclipse will just crash. Either a heap error or a gc overhead limit error. I plan on just deleting this from outside eclipse, but I really want to know if there are any clever ways of attacking this problem. It's less than 14 megs, and I didn't really think that eclipse would have a problem with it, any insights on why?

First, make sure you are invoking a generic text editor. Either name the file with an extension of .txt, or make sure you don't have something like an SQL editor associated with the file type. (Check in Window | Preferences | General | Editors | File Associations). Another possibility is to right-click the file, choose Open With.., then choose 'Text Editor'.
Second, you might need to start Eclipse with a bit more JVM Heap, depending on what else is in the workspace. You do this by either adding command line arguments to your invocation (eclipse -vmargs -Xmx1000M), or editing your eclipse.ini. You can read more details at
http://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F

Related

CDT uses too much memory

I have an AUTOSAR project(1.1k sources) which I want to index using the C/C++ Indexer plugin on eclipse oxygen(4.7.3). After I got an Out of heap space error with -xmx4g I wanted to see how much memory it really needs so I configured -xmx10g, yet it wasn't enough.
Taking a snapshot with jvisualvm.exe from JDK 1.8 I see 7 gb of char[] objects kept in memory.
After about 10 minutes of running, the indexing didn't pass the first file from the 1.1k files to analyze.
What do I have to do to get a fix on such a problem?
Or where should I look to find the root cause?
The best way to get such a problem fixed is to reduce your project to a minimal set of files that reproduce the problem, and then file a CDT bug with the files attached.
The reduction can be done using binary search: delete half the files in your project, and see if the problem persists. If so, delete half of the remaining files, and so on. (It helps to consider dependency order when choosing which files to delete, i.e. avoid deleting a file before deleting files that depend on it.) When you only have a few files left, you can perform the binary search on their contents. Ideally you arrive at a minimal reproducing testcase of maybe 100-200 lines spread out over 1-3 files, at which point you can rename identifiers to be generic and post the code.
I would suggest testing with the latest release (CDT 9.5.2) before doing this, to make sure you're not running into an issue that has already been fixed.
Are you sure, -xmx is accepted .. or is it rather -Xmx.
I usually use the following in eclipse.ini:
-Xms512m
-Xmx4096m
1.1k Sources doesn't sound much (we have much more), but on the other side, some generated files can eat up a lot of memory and performance, e.g. Rte.c and Rte_*.h files (e.g. Rte.c here is about 100k LOC). Together with CDTs features of AST based syntax and semantic highlighting eats up memory and also performance.

java.lang.​ClassNotFo​undExcepti​on in matlabR2014a

I am using MATLAB R2014a. but sometimes give me following error:
Exception "java.lang.ClassNotFoundException: com.intellij.codeInsight.editorActions.FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData
why? Of course I use pycharm IDE along with MATLAB. Is it because it?
See this answer:
Why/How is IntelliJ causing debug output in Netbeans?
This is not related to any setup you've done within MATLAB -- it's apparently something that IntelliJ, WebStorm, or PyCharm has put into the clipboard. It goes away if you don't have one of those programs running at the same time.
This error indicates that MATLAB is not able to locate or read your MATLAB preferences directory. This could be due to a setting or variable on your system which is causing MATLAB to look for your preferences in a location where you do not have read access.
Typically this happens due to running a configuration script for MATLAB such as 'config_matlab.sh' which attempts to set your preferences directory to a non-default location where you do not have read or write access. You should start by removing the portion of the script which sets your environment variable.
You should choose a directory where you have both read and write access. The default location is in your home folder.
I had to copy something to the clipboard that was not from IntelliJ to get this to stop occurring. It was occurring even after I'd closed IntelliJ, presumably because of whatever remained in the Clipboard.
The error is caused when you copy something from intellij which stores serialized objects on the clipboard.
I found a workaround for this, you can just set the error stream to a different PrintStream than the console's err stream.
See this code
PrintStream errStream = System.err;
System.setErr(new PrintStream("error.log"));
and use the errStream later on to set it back.
It is just a work around if you don't want that error to be printed on the console.

Emacs: trying to write something after saving provokes message "file changed on disk. Really edit the buffer?"

Emacs 24 in Ubuntu 14.
I have file opened only in emacs, and it gives me this constantly, after each saving. that is annoying.
This is strange, because earlier everything worked fine. I can hardly guess what could I break during this time. I'am total newbie in Ubuntu, using it according to instructions found in internet.
Now I'm using emacs 23, everything is fine. I guess, I need auto-syncronization of opened buffer with saved file right after saving. Anyway, how can I fix it?
It sounds like some other program on your computer is reading the file when it changes, and possibly even introducing changes (perhaps just to the modification time, rather than to the contents). It's hard to say off-hand just what that would be.
A workaround try M-x global-auto-revert-mode. It will only auto-revert if you have no local modification since the last saving. This is generally a nice mode to turn on if you use multiple editors, and I keep it enabled all the time.
Other ideas:
Check if any other process currently has the file open using fuser /path/to/filename.txt (note: it only shows open file descriptors, not processes that hold the file content in memory and write it later)
Do you use any non-standard filesystem? (check with df -h /path/to/filename.txt and mount)
Is your system time stable? (Manually check date, scan the output of dmesg for obvious errors concerning timekeeping, and look for errors related to NTP in the logfiles in /var/log/.

How to read a file specified in the PyDev environment variables

My Project Euler setup is a PyDev project that I work on from two different computers (one is a Mac, the other is Windows 7). The file structure of the project looks like this:
PROJECT_LOC/
unsolved/
The .py files for the problems I haven't solved
solved/
Problems_001_025/
.py files for problems 1-25
... etc ...
texts/
Any input files provided by Project Euler (e.g., Problem 22)
Every file is named in the pattern Problem###.py or Problem###.txt.
Once I solve a problem, I move it from unsolved to the correct directory in solved, which is where my difficulty comes in:
Given a problem with input, say Problem022.py:
for line in open("../texts/Problem022.txt"):
# read file in
# code to solve the problem
Since I solved Problem 22 a while back, I moved it from PROJECT_LOC/unsolved/ to PROJECT_LOC/solved/Problems_001_025/. Now, (not surprisingly) when I try to run it again, it gives me a no such file error.
So, without changing my file structure, is there a way for me to access the input text files from wherever I am in the project directory?
I was thinking I could do something like open(${PROJECT_LOC}/texts), but I have no idea how to get the PROJECT_LOC from Eclipse at run time, and have it work on both Windows and OS X. I played with what this person did in his question, but couldn't get it to work for me.
I figured it out...
I added an environment variable to the interpreter with the value ${PROJECT_LOC:texts}/ in my Eclipse preferences. I can now use os.environ["PROJECT_EULER_TEXT_FILES"] to pull the location of the input.

PyCharm: Excluding a single file from autocomplete

So, at my job we have grunt.js running to compile all of our js into a single file. This is great little feature of grunt.js (with grunt:requirejs/growl) BUT its causing a problem. PyCharm will frequently freeze for 3 - 10 seconds.
If i disable grunt then the freezing wont happen (since there is no 65 KLOC js file). The files that are combined are being parsed (is what i have narrowed it down to) for autocomplete. How would i remove a single file? I could, potentially create a folder for the combined file, but i really do not want too...
Edit: Better engrish...
Not "remove" a single file, but "exclude" a single file (sorry, brain.speed > finger.speed)
So the answer, the obvious one, is that the file system, with grunts, need to have the automagic combined files in their own directory. Then that directory can be excluded. (Right click, toward the bottom).
Since i did that, my pycharm has yet to freeze.