Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Adding MakeTargets takes a long time and consumes a huge amount of heap

Eclipse SDK Version: 3.3.2
JRE Version: 1.5.0_07
CDT Version: 4.0.3

Hi everybody,

I am currently working on a plugin project where I want to
programmatically add MakeTargets to my C project. The C project has a
lot of folders and sub-folders and in some of these folders I add from 4
to 8 MakeTargets resulting in a few hundred MakeTargets to add. The code
I use to add one of these MakeTargets is this:

...
try
{
   IMakeTarget makeTgtBuild;
   String name = "build(comps, lintgen, projects)";
   makeTgtBuild = tgtMan.findTarget(container1, name);
   if (makeTgtBuild == null)
   {
      // Create 'build' make target
      makeTgtBuild = tgtMan.createTarget(prj, name, targetBuilderID);
      makeTgtBuild.setContainer(container1);
      makeTgtBuild.setBuildAttribute(IMakeTarget.BUILD_TARGET, "comps
lintgen projects");
      if (!tgtMan.targetExists(makeTgtBuild))
      {
            tgtMan.addTarget(container1, makeTgtBuild);
      }
   }
}
catch(Exception e)
{
   e.printStackTrace();
}
...

I call this code in a WorkspaceJob. In general this works, but I have
two problems with this approach:

1.) The call of the method 'addTarget' takes a long time. Is there a way
to speed this up? 
2.) The more serious problem is that I ran out of heap after some time.
I don't know why, but the used heap increases more and more while the
Job that I run adds more targets. I tried to increase the heap for the
Java VM but this does not really solve the problem but only delays it. 
Does anybody has a hint on how to solve this issue?

Regards,
Thomas Merx

end 
 
*******************************************
Harman Becker Automotive Systems GmbH
Geschaeftsfuehrung:  Dr. Wolfgang Ptacek  -  Michael Mauser  -  Regis Baudot
Sitz der Gesellschaft: Karlsbad - Registergericht: Mannheim HRB 361395
 
*******************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
*******************************************


Back to the top