]
Alexander Smirnov reassigned RF-8134:
-------------------------------------
Assignee: Alexander Smirnov (was: Alex Kolonitsky)
Memory leak in the in-process template compiler.
------------------------------------------------
Key: RF-8134
URL:
https://jira.jboss.org/jira/browse/RF-8134
Project: RichFaces
Issue Type: Bug
Components: performance
Affects Versions: 3.3.2.SR1
Reporter: Alexander Smirnov
Assignee: Alexander Smirnov
Priority: Critical
Fix For: 3.3.3.BETA1
In-proces compiled templates are widely used by dynamic stylesheets or complonents like
suggestionBox. These templates are compiled into in-memory object structures what usually
have only one instance in application. These objects are called with special context to
generate request output ( lightweight object pattern ).
<f:call element > caches call parameter values in its instance, even FacesContext
or current component references that are short-time objects. As a results, memory leaks
are occured in the org.ajax4jsf.rendercit.compiler.MethodCallElement class. The source of
problem are inner Signature1 and Signature2 classes:
Signature1(int size) {
arguments = new Object[size + 1];
}
void update(TemplateContext context, Object[] parameters) {
arguments[0] = context;
System.arraycopy(parameters, 0, arguments, 1, parameters.length);
}
}
class Signature2 extends Signature {
Signature2(int size) {
arguments = new Object[size + 2];
}
void update(TemplateContext context, Object[] parameters) {
arguments[0] = context.getFacesContext();
arguments[1] = context.getComponent();
System.arraycopy(parameters, 0, arguments, 2, parameters.length);
}
To avoid memory leaks, only types of the target method should be cached ( not object
instances ).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: