Skip to main content

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

Hi Thomas,

On 8/13/08, Merx, Thomas <TMerx@xxxxxxxxxxxxxxxx> wrote:
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:

What is your workflow, do you generate exactly the same targets in each folder? Do you think it might be a good idea to have some kind of "generic" targets defined on project (or even workspace) level and have Make Targets view to display them in each folder? This way scalability issue could be avoided. I've done something similar before. To get it working Make Target view has to be modified, (or a new view can be created being with a copy of Make View if done as a plugin). Well, this may be even more work, but I'd like to know in general if this approach would suit your workflow.



   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.setBuildAttribute(IMakeTarget.BUILD_TARGET, "comps

lintgen projects");

Looks like lint targets?

      if (!tgtMan.targetExists(makeTgtBuild))
            tgtMan.addTarget(container1, makeTgtBuild);
catch(Exception e)

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?

Thomas Merx


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.
cdt-dev mailing list

Back to the top