Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370369 - Target platform should import launcher arguments same as vm arguments
Summary: Target platform should import launcher arguments same as vm arguments
Status: CLOSED DUPLICATE of bug 339763
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-01 14:37 EST by Oleg Besedin CLA
Modified: 2012-08-31 12:45 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Besedin CLA 2012-02-01 14:37:15 EST
A while ago we increased PermGen space by proving launcher argument. See bug 92250 comment 171 for details.

This still works OK for the "outer" Eclipse instance. However, "inner" Eclipse instances launched in debugger or JUnits do not inherit this memory setting.

After switching to 64-bit VM every now and then I've been running out of memory when running UI tests. Last month I've started to run out of PermGen memory on trivial SDK debugging.

The problem can be easily fixed by supplying something along the lines of "-Xms80m -Xmx512m -XX:MaxPermSize=256m" in the launch configuration Vm options.

The issue with that is that out-of-box debugging on 64-bit VM becomes problematic. The "inner" instance can hang and/or crash with or without displaying the "out of memory" exception. The person not familiar with Eclipse PermGen voes could be easily confused by this.

We need to either increase default settings for launch configs or [better] inherit memory settings from the running process and use them as default.

I am marking this critical as debugging as a very basic task and the problem can now be triggered by debugging 4.2 SDK by itself, without even a need to download other plugins.
Comment 1 Curtis Windatt CLA 2012-02-01 16:46:14 EST
This is not a platform debug issue as each type of launch configuration has different memory requirements. In this case PDE's Eclipse Application launch configuration does have large memory requirements.

However PDE has already implemented what you are asking for :)  Using a new workspace, if you create a new Eclipse application launch configuration, the arguments tab will be prepopulated with the same arguments used to launch your host Eclipse instance.

This is configurable on the Target Platform preference page.  Open up your current target platform and check the arguments tab.  In new workspaces the default target will include all arguments from the host, but on existing workspaces you can hit the import button to grab the arguments you care about. The arguments set in the target platform will be added to *new* Eclipse Application and JUnit Plug-in Test configurations.  This is not done for OSGi framework configurations.

Closing as WORKSFORME.
Comment 2 Oleg Besedin CLA 2012-02-02 13:09:07 EST
(In reply to comment #1)
> However PDE has already implemented what you are asking for :)  Using a new
> workspace, if you create a new Eclipse application launch configuration, the
> arguments tab will be prepopulated with the same arguments used to launch your
> host Eclipse instance.

It does not work for me using Eclipse 4.2M5. 

Using default settings on a clean workspace I get the following VM arguments for the Eclipse Application launch config:

-Xms40m -Xmx384m

Note that those settings do not increase VM default PermGen size (that would be "-XX:MaxPermSize"). The "outer" launcher has in its config.ini:

--launcher.XXMaxPermSize
256m

But the "inner" Eclipse Application instance gets default PermGen size (64M).
Comment 3 Curtis Windatt CLA 2012-02-02 16:35:16 EST
The argument you describe is a launcher argument, not a vm argument.  My Eclipse 4.2 install has the equivalent vm argument set (-xx:MaxPermSize=120m) so it gets included.

Two workarounds:
1) Add the vm argument to eclipse.ini (could cause an error if run on some vms, which is why the launcher argument was introduced).  You will have to reload your target platform for the changes to take effect.
2) Edit your target platform to set the appropriate launcher argument or vm argument to new launch configurations.

PDE could do the following to improve this:
1) Allow the arguments tab to recognize and import launcher arguments like it does for vm's
2) The default target platform could include the launcher arguments, but we don't want to add arguments to configurations where they won't work.
Comment 4 Markus Keller CLA 2012-08-30 10:32:31 EDT
Dup of bug 339763?
Comment 5 Curtis Windatt CLA 2012-08-31 12:45:37 EDT

*** This bug has been marked as a duplicate of bug 339763 ***