java.lang.OutOfMemoryError: Java heap space in Intellij cannot work even if i change memory space - spring

I was just ruined by this error for the whole week. I really don't know what happened, I got this error after compiling the source, I yet write custom code there, the source is fresh from the repo. I asked my friend to run the source and it worked on his laptop.
What I was tried to fix this problem :
File -> Invalidate Cache
Help -> Change Memory Setting (all size was tried) (current size: 2048)
Intellij -> Preference -> Compiler -> Shared Build Process Heap Size (all size was tried) (current size: 6048)
And I am still stuck at that error.
Lately I run this command ./gradlew build --stacktrace --info to see the log, and i had no idea what was that. this is the full result:

You can assign more heap
for your ide --> help | change memory settings
for your current programm --> Run | Edit Configurations... see screenshot
for all programs -->
Set Environment Variable: SET _JAVA_OPTIONS=-Xms512m -Xmx2048m
or
File | Settings | Build, Execution, Deployment | Compiler and set user User-local build process VM options with like 2048
Verify heap size with How to view the current heap size that an application is using?

thanks for all your suggestions guys. I've done it all and got the same result.
finally, I can escape from this bug by running this command ./gradlew build in the terminal and close my Intellij. I don't know what really happened, but now it all working perfectly.
I want to ask u guys, I am new in mac, are partitioning disk in mac book take an effect on its performance?

Related

Removing the proxy and host from Netbeans

I know this questions is not related to programming but I can't find the root problem of my proxy/host.
Ok, let me explain, I am in China, so I have to make use of a VPN. The software is called SSTap and because of that reason I called the host in the same way.
For the project I am trying to make I am using LibGDX and gradle ofc.
After not being able to settle a proxy I removed it, as shown in the picture it is selected as "no proxy" and there are no proxy settings, and down in the output I am getting the warning.
Is there another place to totally remove the host?
I am using "Product Version: Apache NetBeans IDE 12.3"
Thanks in advance I will write down more questions
ReEdit part:
Sorry I thought it was loaded
The warning is: Warning: Failed to parse host SSTap
The way I configure the host/proxy was in a pop-up window that have not appeared anymore and I am unable to find it after setting the host again, the only way that I know to see the host is by Tools -> Options -> General Tab, the picture is not complete but that is the path to get there
I am having difficulties to load the picture, I am in China and I am using a VPN, so it is quite hard to visualize it, since I created the account yesterday I am unable to post pictures and instead they are added by links automatically
picture/warning
enter image description here
enter image description here
I went into my gradle.properties file found in C:\Users\User. gradle inside looks like this:
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Sat Dec 25 18:51:22 CST 2021
systemProp.http.proxyHost=SSTap
systemProp.https.proxyHost=SSTap
systemProp.https.proxyPort=25378
systemProp.http.proxyPort=25378
systemProp.https.nonProxyHosts=127.0.0.1
systemProp.http.nonProxyHosts=127.0.0.1
I removed the last 6 rows,created a new project using Desktop, Android, IOs, HTML in LibGDX , trusted all the projects with gradle, classes have no packages when created, if I create them or import them by myself (in desktop project). And even if it says "cannot find symbol"(class) within the core path e.g. import com.pokedemon.game.Hello;
the code runs
A problem that I had before when trying to resolve problems was: com.android.tools.lint:lint-gradle:26.5.4
Still no packages I closed Netbeans and open it again but again no packages but the proxy and host are fixed now

Getting output from from VS WSL build events

Visual Studio has a relatively new way of doing Linux builds, using the local WSL system. This platform toolset is called WSL_1_0
What in a remote build was called "Remote Pre-Build Event" is now called "Wsl Pre-Build Event" (in the UI..still Remote whatever in msbuild, apparently) and it works basically the same, but with execution occurring in WSL on the local machine rather than on a linux machine.
Aaaand...any script output seems to be swallowed (vs. running on a remote machine where it was displayed in the build window):
1>Target RemotePreBuildEvent:
1> Invoking 'echo "me : stuff error 567 HELLO"', working directory: '/mnt/s/buildroot/CoreTech/ThirdPartyTools/Encryption/Rijndael/Project/Linux'
1>Target ClCompile:
1> Starting remote build
If I replace this with a script, it is executed..but the output is swallowed.
I've tried redirecting to stderr both within the script and within the command and it seems to change nothing. I've also adjusted Tools->Options->Project and Solutions->Build and Run output verbosity as high as I'm willing to (Normal) with no changes.
Anyone have any ideas on solving this?
I've also adjusted Tools->Options->Project and Solutions->Build and
Run output verbosity as high as I'm willing to (Normal) with no
changes.
Normally it's recommended to change the Verbosity to Detailed and higher to see more details. And this is the only option I know in latest VS2019 16.3.7 can control the behavior of output log.
So you can change it to Detailed to check if there's more info to be displayed in output window.(For some reason,my configuration fails for the wsl.exe, so I can't test it myself whether this option can work)
And if the echo info is still not shown, I guess this scenario is not be supported for now since it's quite a new feature. Just post your feedback in DC as the Give Us Feedback in this document suggests. The team there would look and consider about supporting that. May it makes some help :)

Running out of RAM during daemon process

I am trying to make a Minecraft mod. I have set the gradle.properties to use 3GB of ram. If I do this it is able to load the daemon process however it immediately displays
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.14/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 3072000KB object heap
It is running out of RAM, and I have no idea why as I have 16GB installed.
I tried closing all other programs but got the same problem. Next up I changed the gradle.properties to use 1GB and then 2GB of RAM, and instead just got an error saying it ran out of memory (I googled this error and the common solution was to give it some more RAM)
* What went wrong: Execution failed for task ':decompileMc'. > Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_211\bin\java.exe'' finished with non-zero exit value 1
Francisco Mateo recommended I update my gradle version - sadly didn't help.
I tried changing the distributionUrl in the gradle-wrapper.properties to the new version of gradle I am using so it now reads distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
I also tried running InteliJ as administrator. Still no luck.
Not a clue what is happening here - help appreciated. If it makes any difference the error occures at 10:08 of https://www.youtube.com/watch?v=RZ66HdNkank

Error in Cygwin for Moai Android Build

I'm following this tutorial set to set up Moai for Android porting. When I run
./make-host.sh –p com.gamefromscratch.moai
in Cygwin to build the Android host it returns an error of
build.sh: line 17: ndk-build: command not found
I'm 98% certain everything has installed correctly and I've been following the instructions exactly as written. When I look in the shell script line 17 is
use_fmod="false"
I've never had to use shell scripts or set up anything like this before and my scouring of the internet has failed to yield a result.
As a side note, Moai runs perfectly and I haven't had any problems with getting that to work.
I've solved the issue! When I went to look for the environment variable in Windows (Computer -> right click -> properties -> Advanced System Settings -> Environment Variables), I found that the variable path was there but was listed as ‘%PATH;c:\android-ndk’. As an experiment I changed it to just c:\android-ndk and rebooted the computer. I then ran the line to have the host run and it ran through the process without a hitch. The only difference is that instead of untitled-host my file is called host-source and instead of settings-local.sh my file is called d.settings-local.sh. Outside of those minor file name changes everything else is the same.

org.apache.felix.framework.cache.BundleArchive: Unable to create archive directory

googling I gound that this error is shown when windows can't run a .bat
I'm getting this when I'm running roo comand in my workspace.
OS -> windows 7, 32 bits
jdk -> jdk1.6.0_22
roo -> spring-roo-1.1.0.RELEASE
The hole error message is:
ERROR: Unable to create system bundle directory.
ERROR: org.apache.felix.framework.cache.BundleArchive: Unable to create archive directory.
Repeated hundreds of times.
I followed all these steps, but anyway I'm getting the error. Does anybody know why??
I read another similar problem, which was solved moving from OpenJDK to JDK 1.6. But I have already JDK 1.6
Thanks in advance
I also have same issue today on windows 7, 64 bit. after spending some time solved it.
Goto %ROO_HOME%/bin ( for me ROO_HOME = C:\Program Files\springsource\spring-roo-1.1.5.RELEASE)
Right Click Roo.bat and select option 'Run As administrator' from pop-up.
----------------------------------OR-----------------------------
In Run box ( last option in Start button pop-up), type cmd
Instead of hitting Enter, use CTRL + SHIFT + ENTER. Click yes on pop-up box
Command prompt with Administrative Properties will come up, type ROO and it comes up.
( C:\Windows\System32\cmd.exe)
I had the same problem. I did not have the aprropiate rights to the installation folder of roo. Then I changed my rights and everything worked fine.
It's probably because you are running as a 'normal' user yet the internal Felix OSGI container, by default, tries to create a felix-cache directory in the working directory.
Two solutions which are probably better than simply elevating your permissions:
Set the org.osgi.framework.storage system property (e.g. -Dorg.osgi.framework.storage=C:\Users\MyUsername)
Run it from a different working directory, one that you have write permissions for

Resources