Eclipse LibGdx GPGS - java

So I've been following the tutorial found at http://upandcrawling.wordpress.com/2013/08/16/libgdx-and-google-play-game-service-integration/
And I finally got everything in to my application, but I can't compile it in eclipse. I've looked up ways to change the amount of java space, but none really make sense or apply. This is because with libgdx you can't go into the window and preferences and change settings on a class. The classes used to start libgdx just don't appear
2 major questions:
When I try to compile the application it takes quote a few minutes which it never had done before. Is this Normal or should it still only take approximately a minute.
When I do compile it comes with a dex error, so I know it gets through the basic compiling, but why am I getting a java heap error? after all my app isn't like a 1 GB app, I'd reckon it's only about 10 MB, is there a way to increase data space in eclipse and if so how? (Preferably with screenshots, I'm very visual)

An output of your log files would be helpful in troubleshooting.
This is normal (for me anyway) when I compile it could take several minutes to build everything.
Check out these links:
https://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F
Increasing heap space in Eclipse: (java.lang.OutOfMemoryError)

Related

Permanent out of Memory | Java | IntelliJ

i have a Programm with 18 classes. They are working Thread save (checked) have no recursive calls neither do any complex calculation.
But my IDEA always says after some hours
There is not enough memory to perform the requested operation.
Pleace increase 'Xmx' setting and restart the IDE for change to take effect.
So I did that. Atm i have no problem.
But still I wonder if I may have a bug there or a Thread is not terminating properly. Since I use WAMP and some other HTTP fuctions I could image that.
So is there any possibility to see what class/thread consumes what amount of memory?
So far I was teached the VM should have a garbage collector. So why I had to restart the IDE always in the past when that error appeared?
If someone here is familar with IntelliJ he/she could maybe answer me beside how i can make my whole project running on a PC what only has a VM installed. Because in the project folder there are only .java files, no class files. When I try to use console with javac "file.java" i receive only a lot of errors. (Project is used with Maven and Intellij 2016.2.5)
You can dump the memory with "-XX:+HeapDumpOnOutOfMemoryError" when out of memory error happens; or " -XX:-PrintGC and XX:-PrintGCDetails " for heap/GC information.
Set GC is not enough. You have to tune the GC, saying changing heap size, heap generations and when to do GC to get best performance or to avoid out of memory error. More can read on Link.
You can either get the "jar" file or "class" file to run on other platforms. Or, you can regenerate the class file with source codes on the specified platform.

Webstart application fails to start with -Xmx2G on Java 8u60

I have a Java Webstart application that starts successfully with -Xmx1G, but fails to start with -Xmx2G. Some of my users really need 2G of heap.
This seems to be a problem with Java 8u60 only, because I have a report of someone launching successfully with Java 8u51.
The failure looks like this: I see the blue 'Java...' splash screen, and then after a few seconds, poof it's gone, before displaying the Java console and without producing any trace information in the expected place.
The failure occurs only on those clients with less than 2G of memory available. But, I am a little surprised that requesting a 'maximum' heap size could cause the application to fail so early and without any diagnostic information. We are dealing with a 'maximum' value, after all, not an 'initial' value. I read in multiple places that the JVM is not supposed to do this.
But I also remembered reading that the 'initial', if unspecified, is based on the maximum. So, along with passing -Xmx2G, I tried passing -Xms512M, -Xms256M, and -Xms128M. But, this attempt to shrink the initial heap size did not help. I cannot get this thing to start with -Xmx2G!
Does anyone have any light to shed on this situation? A solution? A workaround? In the short term, I'll change to -Xmx1G, but, as I said at the beginning, I have some users that really need -Xmx2G. I'd like to avoid having two separate *.jnlp files, which would also entail having two separate *.jar files!
Turns out that this is exactly what Webstart on Java8u60 does if the client machine does not have enough memory to satisfy -Xmx. It attempts to start, and then poof, it disappears without any indication as to what went wrong.
So, I will end up having to build my application in different configurations if I want to enable the users with more memory to allocate that memory to my application. This is because signing requires the *.jnlp file to into the *.jar file itself, and this *.jnlp file must be an exact match with the *.jnlp file used to launch the application.

IntelliJ IDEA freezing on source code completion

I'm using IntelliJ IDEA 10.0 for Java development. A few days ago it started to reveal a strange behavior with auto-completion: pop-ups with completion options appears as usual,
but IDEA completely freezes after choosing an option.
Cache cleaning doesn't help.
Has anyone else encountered this?
Update: Another symptom: IDEA freezes when trying to auto-implement method (e.g. toString)
This is may be due to garbage collector working hard.
Try give your IDE more memory. You can do it in idea.exe.vmoptions(if you use windows). Increase -xmx property to at least 512 MB.
This may not be the same issue you describe, but I have experienced long (but not eternal) freezes, where after a minute or two it came back to respond. This happened whenever I pressed Ctrl+Alt+Space in the code completion popup, which caused IDEA to load all project and external libraries to browse for possible completion options.

Eclipse 3.6 frequently stalls during Content Assist

The auto complete stalls so frequently and for so long, I quit using it altogether.
I've had success with the following using Eclipse (Classic) 3.6.1 on Windows 7 x64.
"A workaround, until the fix is released in 3.6.2 is summarized here: http://groups.google.com/group/android-developers/msg/0f9d2a852e661cba"
(copied for convenience)
"You can replace your /plugins/
org.eclipse.jdt.core_3.6.1.v_A68_R36x.jar plugin with one from
http://www.google.com/url?q=http://adt-addons.googlecode.com/svn/patches/org.eclipse.jdt.core_3.6.1.v_A68_R36x.zip&ei=vg5aTf2RIMrUgAeI-qTvDA&sa=X&oi=unauthorizedredirect&ct=targetlink&ust=1297749446528273&usg=AFQjCNFv7FGlTrnoVhRGE35JPjHxOwI_Bw
and restart Eclipse. Content Assists will be much better. Just try it.
Don't forget backup your original plugins. "
This solved part of my problem.
In preferences, I defaulted all the 'Java->Editor->Content assist' screens and the performance is much improved. Any lag I have now is due to system speed and is negligible. I've gone from minutes to seconds building the suggestion list.
UPDATE: This didn't completely solve my problem, but it got me close. The search continues...
UPDATE: I'm developing in Java for Android using the default packages that are included and any that might have come down during a update(in retrospect, maybe choosing update all in the SDk update might not have been wise). The timing is fairly consistent online and offline. I did a few tests and found the following:
Startup Eclipse and enter a line of code that can use a .toString(). Typing the '.' populates the auto complete within 2-3 seconds. Type a 't' and it takes 70-75 seconds. After that, 10 seconds. Diff objects do the same thing(75 the first time, 10 after that). It's the filtering process that appears to stall. My CPU does not max, Memory is OK, but the program will go not responding till it's done. Any typeahead gets cached and eventually filters the list when Eclipse starts responding.
For me the problem went away when I increased the memory for the vm.
Put this in your eclipse.ini:
-Xms512m
-Xmx1024m
on my 4GB Windows Vista system this would happen A LOT !! (as well as debug issues when looking up variables).
This all went away after I built my new PC with 8GB RAM. I can now run 4 emulators simultaneously and it doesn't have any debug problems any more either. Auto complete with huge lists also works just fine.
it would seem to be just an issue with how much RAM you've got.

Netbeans OutOfMemoryError: Java heap space, code formatting

When I format code in netbeans, I recently started getting an "OutOfMemoryError: Java heap space" error.
I've been using netbeans for well over 2 years and this just started happening on the typical machine I develop on. Currently using version 6.9, on an XP machine, 4Gb memory. I have adjusted -J-Xmx to 1024m and even tried 2048m, and it still get errors.
This is a small php script, less than 100 lines. I have had no problem in the past formatting 10,000+ lines without editing -J-Xmx or anything else. I am not running any code or debugging or unit testing or anything, just the built-in Source -> Format.
I've tried removing code to see if there was a specific section that is causing problems. From what I can gather, if I add a single control structure, no matter what it contains, I get a memory error.
Even:
if($i == 1) {}
causes the memory error. If I check memory usage, Netbeans has no problem using up all of the memory it can. Any help on this would be appreciated.
Here's the stack trace generated when I get the error:
java.lang.OutOfMemoryError: Java heap space
at org.netbeans.modules.php.editor.indent.FormatVisitor.addFormatToken(FormatVisitor.java:1002)
at org.netbeans.modules.php.editor.indent.FormatVisitor.visit(FormatVisitor.java:859)
at org.netbeans.modules.php.editor.parser.astnodes.Program.accept(Program.java:92)
at org.netbeans.modules.php.editor.indent.TokenFormatter$1.run(TokenFormatter.java:354)
at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:314)
at org.netbeans.modules.php.editor.indent.TokenFormatter.reformat(TokenFormatter.java:344)
at org.netbeans.modules.php.editor.indent.PHPFormatter.reformat(PHPFormatter.java:129)
at org.netbeans.modules.csl.core.GsfReformatTask$1.run(GsfReformatTask.java:105)
at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:154)
at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:138)
at org.netbeans.modules.parsing.impl.TaskProcessor$1.call(TaskProcessor.java:200)
at org.netbeans.modules.parsing.impl.TaskProcessor$1.call(TaskProcessor.java:197)
at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:160)
at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:227)
at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:66)
at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:197)
at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
at org.netbeans.modules.csl.core.GsfReformatTask.reformat(GsfReformatTask.java:95)
at org.netbeans.modules.editor.indent.TaskHandler$MimeItem.runTask(TaskHandler.java:550)
at org.netbeans.modules.editor.indent.TaskHandler.runTasks(TaskHandler.java:317)
at org.netbeans.modules.editor.indent.IndentImpl.reformat(IndentImpl.java:320)
at org.netbeans.modules.editor.indent.FormatterImpl.reformat(FormatterImpl.java:190)
at org.netbeans.editor.ActionFactory$FormatAction$1$1.run(ActionFactory.java:1683)
at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:344)
at org.netbeans.editor.ActionFactory$FormatAction$1.run(ActionFactory.java:1651)
at org.netbeans.modules.progress.ui.RunOffEDTImpl$1.run(RunOffEDTImpl.java:160)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957)
Looks like there are a ton of similar reports to this issue:
http://statistics.netbeans.org/analytics/exception.do?id=472651
Installed 7.0b and reinstalled JRE 6... which is now working fine. Using 7 as 6.9 is unusable when using code formatting. Would still like to figure out how to fix this issue though.
I found this NetBeans bug which reports a problem which sounds similar to yours. It turned out that the problem was to do with SVN, and was cured by clearing out an SVN cache directory. Read through the bug's "comments" for the details.

Categories

Resources