Home » Modeling » EMF » Memory Leak with TextUtils(OCL Validation / Diagnostician)
Memory Leak with TextUtils [message #1721159] |
Mon, 25 January 2016 10:39 |
Michael Longo Messages: 8 Registered: July 2015 |
Junior Member |
|
|
Hello,
I'm trying to implement some OCL validation into my RCP Application. To do so, I'm using Accuracy (a plugin that comes from KitAlpha and that allows you to register your OCLs as EMF Constraints) and I noticed that every time I called the Diagnostician from my Editor and then closed the editor, my model wasn't freed by the GC.
After futher investigation, it appeared that org.eclipse.emf.validation.internal.util.TextUtils keeps a static reference to my model's eobject.
And here is how it happens:
- AbstractOCLModelConstraint.validate calls AbstractValidationContext.createFailureStatus
- which calls TextUtils.formatMessage
- which calls TextUtils.formatScalarValue
- which calls TextUtils.getText
- which calls ComposedAdapterFactory.adapt (via its static attribute 'factory')
- which calls ComposedAdapterFactory.getFactoryForTypes
- which calls ComposedAdapterFactory.addAdapterFactory that adds my ItemProviderAdapterFactory to its 'adapterFactories' attribute.
As a result of that, I have TextUtils that has a final static reference to a ComposedAdapterFactory which contains a reference to my ItemAdapterFactory which contains a reference to my XXXItemProvider which contains a reference to my XXX eobject via its target attribute.
So my main question is : do I have a bad setup that leads to this issue, or is the static factory of TextUtils the issue here?
TextUtils.getText(EObject) line: 73
TextUtils.formatScalarValue(Object) line: 197
TextUtils.formatMessage(String, Object...) line: 161
GetBatchConstraintsOperation$1(AbstractValidationContext).createFailureStatus(Object...) line: 392
OCLConstraint(AbstractOCLModelConstraint<C,CT,CLS,E>).validate(IValidationContext) line: 162
OCLConstraint.validate(IValidationContext) line: 72
BatchValidator(AbstractValidator<T>).evaluateConstraints(AbstractValidationContext, List<IStatus>) line: 241
BatchValidator.validate(AbstractValidationContext, EObject, GetBatchConstraintsOperation, List<IStatus>) line: 264
BatchValidator.validate(ITraversalStrategy, List<IStatus>, AbstractValidationContext, Collection<EObject>, GetBatchConstraintsOperation, Set<IClientContext>) line: 211
BatchValidator.doValidate(Collection<EObject>, Set<IClientContext>) line: 149
BatchValidator(AbstractValidator<T>).validate(Collection<? extends T>) line: 147
BatchValidator(AbstractValidator<T>).validate(T) line: 126
BatchValidator.validate(EObject, IProgressMonitor) line: 117
EValidatorAdapter.validate(EClass, EObject, DiagnosticChain, Map<Object,Object>) line: 164
Diagnostician.doValidate(EValidator, EClass, EObject, DiagnosticChain, Map<Object,Object>) line: 171
Diagnostician.validate(EClass, EObject, DiagnosticChain, Map<Object,Object>) line: 158
Diagnostician.validate(EObject, DiagnosticChain, Map<Object,Object>) line: 137
Diagnostician.validate(EObject) line: 108
(Developping with/for Eclipse Luna)
|
|
| | |
Goto Forum:
Current Time: Fri Mar 29 14:58:37 GMT 2024
Powered by FUDForum. Page generated in 0.02985 seconds
|