Skip to main content

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

> Thanks for your tip. I've already collected this dump. The main
> responsible for the waste of heap seems to be the
> CProjectDescriptionManager. When diving a bit more into this I can see
> that the ResourceChangeHandler is also involved. My assumption is now
> that for every single MakeTarget that I add the
> ResourceChangeHandler is
> invoked and records the changes that I've made. Maybe this is
> the reason
> why the free heap reduces more and more when adding many targets. The
> question now is how can I solve this issue? Can I prevent the
> CProjectDescriptionManager from collecting all these infos? Or can I
> from time to time "flush" this collected changes?

I would have guessed the problem was due to the Project Model.  Basically every time you add a make target, the project description is being modified and saved.  As the projectdescription is stored as an XML file, creating a writeable description causes the entire document to be duplicated.  Old versions can hang around as thread local variables, during creation of project model deltas, as well as by being held by different threads and static variables (e.g. AbstractPage.java) .

Until this is fixed, a potential solution might be to modify MakeTargetManager locally.  You could change the semantics of addTarget so that MakeTargetManager holds the set of make targets you're adding locally until you explicitly call MakeTargetManager.save() which would have the same effect as MakeTargetManager.writeTargets.  (you'd also need to modify all the places where CDT calls addTarget to also call your new save method.)

Cheers,

James

>
> Regards,
> Thomas
>
> >Cheers,
> >
> >James
>
> *******************************************
> 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
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>



Back to the top