mace-opensaml-users - SAMLResponse leak?
Subject: OpenSAML user discussion
List archive
- From:
- To:
- Subject: SAMLResponse leak?
- Date: Thu, 11 Aug 2005 12:44:55 -0400 (EDT)
Hi,
I think I have a memory leak problem when creating a SAMLResponse from a
signed assertion. I've made a short test program which just loops around the
SAMLResponse(InputStream, int) constructor. It seems to leak about 60kB each
time, and eventually hits OutOfMemory. What am I missing? Do I need to set
some properties for XML parser, or something?
I'm on a Win2000 with JDK 1.5.0_03.
In CLASSPATH: opensaml-1.1, log4j-1.2.9, commons-codec-1.3, xmlsec-20050514,
commons-logging-1.03.
Test program:
static final String assertionString = "<Response xmlns= ...";
public static void main(String[] args) {
try {
byte[] clearTextAssertion = assertionString.getBytes();
ByteArrayInputStream is = new
ByteArrayInputStream(clearTextAssertion);
for (int i = 0; i < 1000; ++i) {
SAMLResponse response = new SAMLResponse(is,1);
String recipient = response.getRecipient();
System.out.println(getMemInfo() + ", recipient = " + recipient +
", i = " + i);
is.reset();
System.gc();
}
} catch (SAMLException e) { e.printStackTrace(); }
}
private static String getMemInfo() {
Runtime rt = Runtime.getRuntime();
long heapSize = rt.totalMemory()/1000;
long heapUsed = heapSize-rt.freeMemory()/1000;
return "memory: used heap " + heapUsed +
" of " + heapSize + " kB ";
}
Best regards,
Per Fry kenvall
- SAMLResponse leak?, perfry, 08/11/2005
- Exception while verifying a Response, Ashu, 08/11/2005
- RE: Exception while verifying a Response, Scott Cantor, 08/11/2005
- Help with SAML !, Vikram Reddy Andem, 08/11/2005
- RE: Help with SAML !, Scott Cantor, 08/11/2005
- RE: SAMLResponse leak?, Scott Cantor, 08/11/2005
- <Possible follow-up(s)>
- Re: RE: SAMLResponse leak?, perfry, 08/12/2005
- RE: RE: SAMLResponse leak?, Scott Cantor, 08/12/2005
- Re: RE: RE: SAMLResponse leak?, perfry, 08/26/2005
- RE: RE: RE: SAMLResponse leak?, Scott Cantor, 08/26/2005
- Re: RE: RE: RE: SAMLResponse leak?, perfry, 08/29/2005
- Exception while verifying a Response, Ashu, 08/11/2005
Archive powered by MHonArc 2.6.16.