Memory Setting for OC4J in Eclipse - eclipse

I've looked on the web for a while and can't seem to find the setting to increase the memory allocated to OC4J when launching from Eclipse. Does anyone know where the setting is?
Thanks.

You can add memory setting in the OC4J_JVM_ARGS environment variable. For example you could have something like:
OC4J_JVM_ARGS=-Xmx512m
You could add others if you want:
OC4J_JVM_ARGS=-XX:PermSize=256m -XX:MaxPermSize=256m -Xms1024m -Xmx2048m
Now, I never have run OC4J from Eclipse (only standalone), but you could do the same by selecting your Server view, then Open launch configuration and in the Arguments tab add the values to the VM arguments section directly like:
-Xmx512m
or
-XX:PermSize=256m -XX:MaxPermSize=256m -Xms1024m -Xmx2048m

Related

CQ5 debug bundles using eclipse won't halt

I created a bundle that I already uploaded, but I would like to debug it.
I started the server with debug mode:
java
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -XX:MaxPermSize=256m -Xmx1024M -jar AEM_6.0_Quickstart.jar
Then I set to the project that packaged into the bundle its remote debugging configuration. But when I set the breakpoints in the project, it won't halt where it needs to when the lines are executed.
Below are some steps that can be helpful. Use that command line to start your CQ instance.
java -jar cq5-author-4502.jar -fork -forkargs -- -Xdebug -Xrunjdwp:transport=dt_socket,address=59865,suspend=n,server=y -Xmx1520m -XX:MaxPermSize=512m -XX:-UseSplitVerifier
I have simple title component in which I am calling some service method. And applied some breakpoints in service. I have multi-module eclipse project practice. Setup eclipse debug configurations as shown below :
Inside source add project's module as shown below :
Click on the debug button and refresh the cq page. You will see below image:
Open the Eclipse in debug prospective you can see you variables over there and page still loading as you not complete the method execution.
Hope this will Help!!
Thanks
Replace CQ_JVM_OPTS at cq5/aem directory >> crx/bin/start
CQ_JVM_OPTS='-server -Xmx1024m -XX:MaxPermSize=256M -Djava.awt.headless=true -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=30303,suspend=n'
Increase the heap size which is allocated to CQ process.
Make XX:MaxPermSize=512m and try.

How to add XX:PermSize to every run config

Recently all my runs of my java code eclipse have been giving me permMem errors.
I can fix this with adding
-XX:PermSize=128M -XX:MaxPermSize=256M
to the dun/debug config, but I don't want to keep doing this. My eclipse config has:
eclipse.vm=C:\Windows\system32\javaw.exe eclipse.vmargs=-Xms384m
-Xmx768m
-XX:MaxPermSize=384m
You can make your VM options to be shared by new run/debug launches by adding you options to Launching Arguments.
It is explained here.
Edit:
My first answer was about plug-in development, sorry about that. You can add shared vm options by:
Window->Preferences->Java->Installed JREs->Select Your JRE->Edit->Add your vm arguments to Default VM Arguments
This adds your VM arguments to your Java application run/debug configurations.

How to increase application heap size in Eclipse?

Some say I need to do that in Run Configurations for my application. When I open that window, could you please tell me how to set the right argument and the amount of memory? Say how to set 2GB or 1.5GB?
In the run configuration you want to customize (just click on it) open the tab Arguments and add -Xmx2048min the VM arguments section.
You might want to set the -Xms as well (small heap size).
Go to Eclipse Folder
Find Eclipse Icon in Eclipse Folder
Right Click on it you will get option "Show Package Content"
Contents folder will open on screen
If you are on Mac then you'll find "MacOS"
Open MacOS folder you'll find eclipse.ini file
Open it in word or any file editor for edit
...
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
...
Replace -Xms512m to -Xmx1024m
Save the file and restart your Eclipse
Have a Nice time :)
Find the Run button present on the top of the Eclipse,
then select Run Configuration ->
Arguments, in VM arguments section just mention the heap size you want to extend as below:
-Xmx1024m
In Eclipse Folder there is eclipse.ini file. Increase size -Xms512m
-Xmx1024m
Open eclipse.ini
Search for -Xmx512m or maybe more size it is.
Just change it to a required size such as I changed it to -Xmx1024m

Debug eclipse plugin project -- PermGen space, out of memory error

I have a plugin project. When i debug this as an eclipse application, in the 2nd eclipse that opens, I want to open Project explorer window. As soon as I click on the button to do this, I get java.lang.OutOfMemoryError: PermGen space. I tried changing the PermGen space in the preference, but it did not help. Can any one please suggest a solution.
You should add the -XX:MaxPermSize=256m or 512m to the Window>Preferences>Java>Installed JREs preference page. Edit a JRE and add it to the Default VM arguments tab.
The eclipse native launcher uses the eclipse.ini to add extra permgen arguments to Oracle JVMs, but that information is not used during runtime launching.
What if you try to extend the memory of eclipse when it starts. To do that simply open the .ini file (inside your eclipse folder) and edit the lines that refer to permSize and memory size:
e.g.
-XX:MaxPermSize=500m
-Xms500m
-Xmx2000m
If you don't want to set the permgen size for EVERY launch, you can also add the Parameter to the Debug Configuration.
Run > Debug Configurations
Choose the "Eclpise Application"-Configuration on the right side and choose Arguments in the Tabs.
Add -XX:MaxPermSize=512m to the VM arguments:
-Dosgi.requiredJavaVersion=1.6 -Xms256m -Xmx4g -Dfile.encoding=UTF-8 -XX:MaxPermSize=512m

M2Eclipse crashes Eclipse: java heap space

I have installed M2Eclipse plugin for maven , but after installing plugin when i tried to proceed then eclipse shows error's and get crashed,slow or hanged.
It shows following error : Background Indexer Crash Recovery
java heap space .. and many more similar exceptions.
I have increased heap size in eclipse.ini file but this issue was not get solved. I have also increased heap space using command : java -Xms -Xmx through command line ,still its not working.
set eclipse.ini
-Xms512m
-Xmx1024m
solved my m2eclipse retrieving prototype problem
I met the same problem, but, it's not working to increase the heap space. So, I created a new workspace, amazing, everything was normal: I could see the archetypes list again. I guessed something wrong with the m2eclipse plugin, So, I deleted the folders that whoes name contains characters 'm2e' in the path 'workspace.metadata.plugins'. And then, I restarted the eclipse, everything returned to normal.The problem has been solved.
In eclipse.ini, I changed
-Dosgi.requiredJavaVersion=1.7 -Xms40m -Xmx1024m -XX:MaxPermSize=512m
to
-Dosgi.requiredJavaVersion=1.7 -Xms512m -Xmx1024m -XX:MaxPermSize=512m
In other words, I raised the initial heap size. That resolved it for me. My allowed heap size when actually running Eclipse Indigo rose from 64 MB to 169 MB
I did all of the above, to no change -
I ended up just creating a new workspace! And everything went back to normal ..
Matt
Mine worked by change
-Dosgi.requiredJavaVersion=1.7 -Xms512m -Xmx1024m -XX:MaxPermSize=512m