Does anyone experienced and know how to fix this issue:
Android Studio sometimes (randomly) does not show any content in dialogs (find, commit, compare dialogs). It takes a part of screen which was visible in that area where dialogs appears. And content of dialog is not refreshed and not visible at all.
All functionality of that dialog works, just I can't see anything.
Here's how it looks like:
Anyone knows how to fix this?
I'm working on Ununtu 15.04 with Android Studio 1.2.1.1, which is based on IntelliJ IDEA.
Java version is 1.8:
vilius#vilnius:~$ java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
vilius#vilnius:~$
STUDIO_JDK=/usr/lib/jvm/jdk1.8.0_60 add to /etc/environment
create new Launcher over old: Android Studio - Tools -CreateDesktopEntry
So apparently it's because I've done "Lock to Launcher" to keep Android Studio visible in Launcher all the time. It creates shortcut which then uses OpenJDK instead of Oracle Java.
That's when I'm getting this message:
OpenJDK shows intermittent performance and UI issues. We recommend
using the Oracle JRE/JDK.
In android-studio/bin/studio.sh file it's written, that $STUDIO_JDK environment variable is used to determine which java to use when launching Android Studio IDE.
To find which java is running for your Android Studio, you can check System Monitor:
Or Android Studio-> about also tells you which JVM is used:
The answer
Install Oracle Java. Create $STUDIO_JDK environment variable which directs to Oracle Java. Don't use Lock to Launcher functionality.
It's Ubuntu's bug, and solution is to just kill compiz. You can do it from command line or System monitor.
All running applications will be brought to 1st desktop, and you'll be able to continue your work.
Tried both Oracle and OpenJDK Java by setting STUDIO_JDK environment variable:
#export STUDIO_JDK=/usr/lib/jvm/java-8-oracle
export STUDIO_JDK=/usr/lib/jvm/java-7-openjdk-amd64
Still experiencing this issue sometimes. :/
Changing Settings->Appearance & Behavior->Appearance->UI Options->Theme does not help either.
Apparently, it's Ubuntu's bug:
https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1072206
Bug Description
[ Impact ]
With nVidia hardware from time to time window content is rendered
black or transparent. The problem manifests more frequently as
session uptime increases.
Apparently the problem was caused by textures being cached and
not freed, resulting in memory exhaustion conditions. It turns out
the texture caching is unnecessary anyway.
[ Test Case ]
Verification requires an nVidia GPU with proprietary drivers.
The problem can not be reproduced at will, only after some
time (depending on resident GPU memory and usage) and even
then only randomly and unreliably.
[ Regression Potential ]
It is unlikely this change has the potential to introduce
new regressions.
[ Other Info ]
Fix was cherry-picked from the Ubuntu "Vivid Vervet" dev release
where it has been in use for some weeks without problem.
Related
Whenever I try to run my JavaFX problem I encounter a MacOS error, My code runs fine on other devices so I am not sure what is wrong.
Im using an M1 mac, with Java 17 and JavaFX up to the latest version. When running the JavaFX App, it opens up the gui for either 1 second or 30 seconds before crashing and spitting out the error provided. Any help would be greatly appreciated, and if you have other questions or need more info lmk.
I believe it's a problem with a /private/TMP folder or something with what I've seen online, but I can be completely wrong since that folder is basically empty right now so I don't see it being full or whatever.
If anyone can help or has any idea, I would really appreciate some feedback.
A fatal error has been detected by the Java Runtime Environment:
SIGBUS (0xa) at pc=0x000000010c0314f0, pid=1056, tid=28943
JRE version: Java(TM) SE Runtime Environment (17.0.1+12) (build 17.0.1+12-LTS-39)
Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.1+12-LTS-39, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
Problematic frame:
v ~StubRoutines::SafeFetchN
No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
An error report file with more information is saved as:
/Users/peter/Desktop/BookStore/hs_err_pid1056.log
If you would like to submit a bug report, please visit:
https://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug
Update your JavaFX version to the most recent available.
JavaFX bug reports mentioning:
stubroutines::SafeFetchN
are closed as duplicates of JDK-8275723, even though the crash error message there is slightly different.
Bug reports related to this are logged when trying to run early versions (less than 17.0.2) of JavaFX 17 on some M1 macs using the Monterey OS.
The linked case report recommends using JavaFX version 17.0.2 when it is released and notes a fix is also in the most recent JavaFX 18 early access releases, which are available for download.
Asker notes in comments:
I updated the JavaFx to 18 and it's all good
Another asker noted in comments on a duplicate:
I just tried to run the project with a JDK version 17.0.2 and it seems to work perfectly fine
I have a 17.0.2 one (newest version from Bellsoft Liberica).
Yes the issue is with JDK 17 Oracle. I have tried Azul Zulu JDK 17.34.19 and its working great! I am linking it below
Azul Zulu JDK 17 Download Page
I am trying to setup Android Studio on my Mac. It is running OSX 10.9.1 Mavericks. I have installed the latest JDK (at the time of writing 1.7 update 45), and I installed Android Studio. I use Java 7 because I have some Java applications I have to run and they require 1.7. I have not installed Java 1.6, because it is ancient and old. Launching Android Studio from any launcher does literally nothing. Activity Manager never shows it running. I do not want to install Java 1.6.
I did some work and tried to run the executable via command line through the package contents, and for both executables, I get these messages:
I am unsure what I am supposed to do to fix this error. I'm not very adept on a Mac (still somewhat new to it, and its confusing to do power user stuff on this) so if anyone can help me figure it out that'd be great. I'm on the 2013 Macbook Air with plenty of resources for this to run.
Update: This also applies to Yosemite, El Capitan, and all the other versions of OSX that can run Android Studio.
Update 12/11/2014
As of Android Studio 1.0 RC3 you can follow this set of directions to make it work.
I figured it out. You have to edit the android studio's Info.plist file in the package so it uses 1.7. I don't get why Android Studio insists we install and use an outdated, vulnerable version of Java.
Full resolution: http://i.stack.imgur.com/yyYaG.png
To open the package you need to find the Android Studio.app file in the Applications folder and right click it > Show Package Contents.
Edit the plist (I think you might need to be root) and change JVMVersion from 1.6* to 1.7* (or 1.8*, or whatever JDK major version you have). I don't get why that made a difference since my original output said it was using 1.7 anyways.
This fix seems to apply to all of IntelliJ's IDEs (I've seen it on PyCharm as well), though other ones seem to support newer versions of java natively.
As answered by hasternet # Android Studio was unable to find a valid Jvm (Related to MAC OS)
For quick and dirty solution, Follow the answer by Mgamerz; open Android Studio in Finder (CTRL+Click > Show Package Contests > Contents > info.plist) and edit Key JVMOptions>JVMVersion from "1.6*" to "1.6+"
Recommended method as discovered by Antonio Jose is to edit environment variables in MacOS (messing with info.plist is not recommended)
either at program launch (opening the Studio through terminal rather than the icon)
$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
$ open /Applications/Android\ Studio.app
or setting up the environment through AppleScript at every MacOS startup:
do shell script "launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk"
do shell script "launchctl setenv STUDIO_PROPERTIES /Users/username/Library/Preferences/AndroidStudio/idea.properties"
do shell script "launchctl setenv STUDIO_VM_OPTIONS /Users/username/Library/Preferences/AndroidStudio/studio.vmoptions"
(Remember to save the script as Application. Antonio Jose managed with just the first line - AFAIK you can use .properties and .vmoptions to set up additional settings.)
Official instructions: http://tools.android.com/tech-docs/configuration/osx-jdk
(The reason why Android Studio want's to run off of JRE 1.6 is because it apparently makes the fonts look better - feel free to go through that "official" route and install JRE 1.6 # http://support.apple.com/kb/DL1572 - you can then set the JDK to 1.8 in the SDK Location settings - local.properties)
mgamerz is right - The release notes give a much better solution for rc3 and onwards - theres a idea.properties file
(or environment variable)
~/Library/Preferences/AndroidStudio/idea.properties
it also shows what environment variables you can use to set things like the jdk
export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk
ref : http://tools.android.com/recent/androidstudio1rc3_releasecandidate3released
I did below command on Mac Terminal to fix this problem, please make sure java version and path.
$java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
$ open /Applications/Android\ Studio.app
Hey Friends I just Figured it out a simple way to fix this for Mac users.
Open Terminal and type this -> java -version and hit enter.
Output will be something like this:
Now check your Java Version. My Java version is 1.8
So now we need to Open Contents of our Android App.
For that right click the Android.app and then select Show Contents
Like this
Now there will be Content folder, Open that Folder and there you will find Info.plist
Open this info.plist
And you will see this.
In this expand the JVM
Here you will see the JVM version showing 1.6* but our jvm version is 1.8 (for example my jvm version is 1.8)
So we need to change this number according to our jvm version, so i changed it to version 1.8*
Then click save. And you are done.
Now you will see setup wizard running
And you are ready to start your first android programming app.
Here is the Whole Docx file for Android Studio Setup in Mac X
LINK: https://www.dropbox.com/s/9jwjebn5hgydyll/Android%20Studio%20Setup%20on%20Mac.docx?dl=0
I found that downloading an extra Java bundle from Apple fixed the issue.
If you search for this problem then I found the second link was to a blog having exactly this problem, all credit goes to him here
I know that posting links isn't an answer but as you can see from the resolution you need to make sure you have an up to date version of Java and also the Java bundle from Apple, for this reason I have also included the searches needed to get to these websites.
Here is where to download the latest version of Java
If this link is broken then searching "java latest version" return it at the top of the Google list
Here is where to download the Apple Bundle
If this link is broken then searching "Java for OS X 2014-001" returns it at the top of the Google list
For me trying to solve this problem it appears that initially it was an issue that required a work around and then Apple released an official work around download meaning that fiddling in plists is not necessary any more.
I've upgraded to IDEA 12 and become frustrated with the slow response. Class navigation takes several seconds to populate the search list (previously it was instantly), any dialog relevant to file list operation hangs for minutes. Move a class to another package just hang up and I have to kill the process. Does anyone have the same experience with me?
Additional information:
I am on windows 7
I tried both 64 and 32 versions and both have the same issue
My 64bit vmoption file has the following configuration:
I have the log dir zipped and put on http://ge.tt/1JwgAnU/v/0. When I start to generating the log dir, I clean it first and then start IDEA 64 bits, open a project (automatically), then invoke File > import module command. I observed there are around a minutes delay before the dialog popped up. And inside the log dir I see a threadDumps-20130106-091041-IU-123.100 folder. However there is no exception found in the idea.log file.
Updates
A screenr showing IDEA hang up when trying to move one class to another package by drag and drop: http://www.screenr.com/zlA7
I found the problem is caused by JDK 8 ea installed in my windows 7. IDEA use exe4j to load JDK, which automatically picked up JDK 8 (See this question).
After I defined IDEA_JDK_64 environment variable and point that to my JDK 6, a high performance IDEA comes back!
I had the exact same, but solved it by changing a setting the idea64exe.vmoptions:
from...
-XX:ReservedCodeCacheSize=64m
...to...
-XX:ReservedCodeCacheSize=256m
I had this problem with RubyMine (uses the same codebase) and it was because my system had swiched to OpenJDK instead of Sun/Oracle JDK.
I see that someone had similar problems in this thread: OpenJDK or Sun Java for IntelliJ IDEA
Specifically, do you see something like the following when you start your IDE from the terminal?
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b24~pre2-1)
OpenJDK Server VM (build 20.0-b12, mixed mode)
WARNING: You are launching IDE using OpenJDK Java runtime.
THIS IS STRICTLY UNSUPPORTED DUE TO KNOWN PERFORMANCE AND GRAPHICS PROBLEMS!
NOTE: If you have both Oracle (Sun) JDK and OpenJDK installed
please validate either IDEA_JDK, JDK_HOME, or JAVA_HOME environment variable points to valid Oracle (Sun) JDK installation.
See http://ow.ly/6TuKQ for more info on switching default JDK
Press Enter to continue.
Perhaps you should check if the upgrade caused the IDE to revert to a non-Oracle JDK.
In my case it was a Findbugs plugin that caused frequent lags. You can see this if you run IDEA from the terminal and look at the log output, e.g.
No classfiles specified; output will have no warnings
After disabling the real-time Findbugs scans (Settings -> Inspections -> Findbugs IDEA) everything ran smoothly again.
I use Selenium with HtmlUnitDriver with javascript enabled and I get Out Of Memory errors (I use Java). I just browse the same page. I am only using a single GET command. Which is the solution to overcome the situation?
I've had a similar issue. It ended up being an issue with auto-loading of frames... a feature that can't be disabled.
Take a look at this: Extremely simple code not working in HtmlUnit
It might be of help.
Update
Current version of HtmlUnit is 2.10. I started using HtmlUnit from version 2.8 and each new version ended up eating more memory. I got to a point in which fetching 5 pages with javascript enabled resulted in a process of 2GB.
There are many ways to improve this situation from a javascript point of view. However, when you can't modify the javascript (eg: if you are crawling a site) your hands are tied. Disabling javascript is, of course, the best way to go. However, this might result in fetched pages being different from the expected ones.
I did manage to overcome this situation, though. After many tests, I noticed that it might not be an issue with HtmlUnit (which I thought was the guilty one from the beginning). It seemed to be the JVM. Changing from Sun's JVM to OpenJDK did the trick and now the process instead of eating 2GB of memory only requires 200MB. I'm adding version information.
Sun's (Oracle) 32-bit JVM:
$java -version
java version "1.6.0.26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)
OpenJDK 32-bit JVM:
$java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze2)
OpenJDK Server VM (build 14.0-b16, mixed mode)
Operative system:
$ uname -a
Linux vostro1015 2.6.32-5-686-bigmem #1 SMP Sun May 6 04:39:05 UTC 2012 i686 GNU/Linux
Please, share your experience with this.
Give more memory to the JVM by adding this to the java command line that starts the JVM in which Selenium is running:
-Xmx512m
This example give a maximum of 512 Mb to the JVM.
It depends on where you're running Selenium from. If maven, you can add it to the MAVEN_OPTS environment variable, if Eclipse, you'll need to edit the run configuration for the test class, etc.
Related to HtmlUnit:
Do not forget to call webClient.closeAllWindows();. I always put it in a finally-block around the area I use the webclient. This way it is sure that all javascript is stopped and all resources are released.
Aslo useful is setting for the webClient:
webClient.setJavaScriptTimeout(JAVASCRIPT_TIMOUT);
webClient.setTimeout(WEB_TIMEOUT);
webClient.setCssEnabled(false); // for most pages you do not need css to be enabled
webClient.setThrowExceptionOnScriptError(false); // I never want Exceptions because of javascript
JAVASCRIPT_TIMOUT should be not too high long running javascript may be a reason for memory problems.
WEB_TIMEOUT think about how long you want to wait maximal.
I have been getting semi-frequent freezes when running Java apps through NetBeans 6.9.1. As soon as netbeans would finish compiling my app and then start to run it, my pc would freeze, i could still move my mouse and mp3s would still play in the background but i couldn't interact with anything on the screen at all, not even windows icons and the task bar. No ctrl+alt+delete, nothing. And if i kept clicking the mouse around 5 or so times trying to get the system to respond, my mouse would also stop responding.
For a while it seemed like cleaning and rebuilding through netbeans once per startup would fix the problem, but then it happened independent of this.
More importantly, i have got just today for the first time been able to reproduce the freeze by launching a java app outside of Netbeans, through a .bat file.
If anyone has any suggestions on resolving this issue i would much appreciate it.
When i reproduced the freeze outside of the ide i was running javaw and java's version info is:
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode
the problem is also independed of the java app i'm running.
Seriously, some Java-related system lockups are related to graphics acceleration driver issues. Try launching your Java app with 2D acceleration disabled.