Potential Memory Leak during Marshelling of a Web Service Response

I believe I have found a memory leak when using the configuration below.
The memory leak occurs when calling a web service. When the web service function is marshelling the response of the function call, an "500 Internal Server Error ... java.lang.OutOfMemoryError" is returned from OC4J. This error may be seen via the TCP Packet Monitor in JDeveloper.
Unfortunately no exception dump is outputted to the OC4J log.
Configuration:
Windows 2000 with 1 gig ram
JDeveloper 9.0.5.2 with JAX/RPC extension installed
OC4J 10.0.3
Sun JVM version 1.4.2_03-b02
To demonstrate the error I created a simple web service and client. See below the client and web service function that demonstrates it.
The web service is made up of a single function called "queryTestOutput".
It returns an object of class "TestOutputQueryResult" which contains an int and an array.
The function call accepts a one int input parameter which is used to vary the size of array in the returned object.
For small int (less than 100). Web service function returns successfully.
For larger int and depending on the size of memory configuration when OC4J is launched,
the OutOfMemoryError is returned.
The package "ws_issue.service" contains the web service.
I used the Generate JAX-RPC proxy to build the client (found in package "ws_issue.client"). Package "types" was
also created by Generate JAX-RPC proxy.
To test the web service call execute the class runClient. Vary the int "atestValue" until error is returned.
I have tried this with all three encodings: RPC/Encoded, RPC/Literal, Document/Literal. They have the
same issue.
The OutOfMemory Error is raised fairly consistently using the java settings -Xms386m -Xmx386m for OC4J when 750 is specified for the input parameter.
I also noticed that when 600 is specified, the client seems to hang. According to the TCP Packet Monitor,
the response is returned. But, the client seems unable to unmarshal the message.
** file runClient.java
// -- this client is using Document/Literal
package ws_issue.client;
public class runClient
public runClient()
* @param args
* Test out the web service
* Play with the atestValue variable to until exception
public static void main(String[] args)
//runClient runClient = new runClient();
long startTime;
int atestValue = 1;
atestValue = 2;
//atestValue = 105; // last one to work with default memory settings in oc4j
//atestValue = 106; // out of memory error as seen in TCP Packet Monitor
// fails with default memory settings in oc4j
//atestValue = 600; // hangs client (TCP Packet Monitor shows response)
// when oc4j memory sessions are -Xms386m -Xmx386m
atestValue = 750; // out of memory error as seen in TCP Packet Monitor
// when oc4j memory sessions are -Xms386m -Xmx386m
try
startTime = System.currentTimeMillis();
Ws_issueInterface ws = (Ws_issueInterface) (new Ws_issue_Impl().getWs_issueInterfacePort());
System.out.println("Time to obtain port: " + (System.currentTimeMillis() - startTime) );
// call the web service function
startTime = System.currentTimeMillis();
types.QueryTestOutputResponse qr = ws.queryTestOutput(new types.QueryTestOutput(atestValue));
System.out.println("Time to call queryTestOutput: " + (System.currentTimeMillis() - startTime) );
startTime = System.currentTimeMillis();
types.TestOutputQueryResult r = qr.getResult();
System.out.println("Time to call getresult: " + (System.currentTimeMillis() - startTime) );
System.out.println("records returned: " + r.getRecordsReturned());
for (int i = 0; i<atestValue; i++)
types.TestOutput t = r.getTestOutputResults();
System.out.println(t.getTestGroup() + ", " + t.getUnitNumber());
catch (Exception e)
e.printStackTrace();
** file wsmain.java
package ws_issue.service;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.server.ServiceLifecycle;
public class wsmain implements ServiceLifecycle, ws_issueInterface
public wsmain()
public void init (Object p0) throws ServiceException
public void destroy ()
System.out.println("inside ws destroy");
* create an element of the array with some hardcoded values
private TestOutput createTestOutput(int cnt)
TestOutput t = new TestOutput();
t.setComments("here are some comments");
t.setConfigRevisionNo("1");
t.setItemNumber("123123123");
t.setItemRevision("arev" + cnt);
t.setTestGroup(cnt);
t.setTestedItemNumber("123123123");
t.setTestedItemRevision("arev" + cnt);
t.setTestResult("testResult");
t.setSoftwareVersion("version");
t.setTestConditions("conditions");
t.setStageName("world's a stage");
t.setTestMode("Test");
t.setTestName("test name");
t.setUnitNumber("UnitNumber"+cnt);
return t;
* Web service function that is called
* Create recCnt number of "records" to be returned
public TestOutputQueryResult queryTestOutput (int recCnt) throws java.rmi.RemoteException
System.out.println("Inside web service function queryTestOutput");
TestOutputQueryResult r = new TestOutputQueryResult();
TestOutput TOArray[] = new TestOutput[recCnt];
for (int i = 0; i< recCnt; i++)
TOArray[i] = createTestOutput(i);
r.setRecordsReturned(recCnt);
r.setTestOutputResults(TOArray);
System.out.println("End of web service function call");
return r;
* @param args
public static void main(String[] args)
wsmain wsmain = new wsmain();
int aval = 5;
try
TestOutputQueryResult r = wsmain.queryTestOutput(aval);
for (int i = 0; i<aval; i++)
TestOutput t = r.getTestOutputResults()[i];
System.out.println(t.getTestGroup() + ", " + t.getUnitNumber());
catch (Exception e)
e.printStackTrace();
** file ws_issueInterface.java
package ws_issue.service;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface ws_issueInterface extends java.rmi.Remote
public TestOutputQueryResult queryTestOutput (int recCnt) throws java.rmi.RemoteException;
** file TestOutputQueryResult.java
package ws_issue.service;
public class TestOutputQueryResult
private long recordsReturned;
private TestOutput[] testOutputResults;
public TestOutputQueryResult()
public long getRecordsReturned()
return recordsReturned;
public void setRecordsReturned(long recordsReturned)
this.recordsReturned = recordsReturned;
public TestOutput[] getTestOutputResults()
return testOutputResults;
public void setTestOutputResults(TestOutput[] testOutputResults)
this.testOutputResults = testOutputResults;
** file TestOutput.java
package ws_issue.service;
public class TestOutput
private String itemNumber;
private String itemRevision;
private String configRevisionNo;
private String testName;
private String testConditions;
private String stageName;
private String testedItemNumber;
private String testedItemRevision;
private String unitNumber;
private String testStation;
private String testResult;
private String softwareVersion;
private String operatorID;
private String testDate; // to be datetime
private String comments;
private int testGroup;
private String testMode;
public TestOutput()
public String getComments()
return comments;
public void setComments(String comments)
this.comments = comments;
public String getConfigRevisionNo()
return configRevisionNo;
public void setConfigRevisionNo(String configRevisionNo)
this.configRevisionNo = configRevisionNo;
public String getItemNumber()
return itemNumber;
public void setItemNumber(String itemNumber)
this.itemNumber = itemNumber;
public String getItemRevision()
return itemRevision;
public void setItemRevision(String itemRevision)
this.itemRevision = itemRevision;
public String getOperatorID()
return operatorID;
public void setOperatorID(String operatorID)
this.operatorID = operatorID;
public String getSoftwareVersion()
return softwareVersion;
public void setSoftwareVersion(String softwareVersion)
this.softwareVersion = softwareVersion;
public String getStageName()
return stageName;
public void setStageName(String stageName)
this.stageName = stageName;
public String getTestConditions()
return testConditions;
public void setTestConditions(String testConditions)
this.testConditions = testConditions;
public String getTestDate()
return testDate;
public void setTestDate(String testDate)
this.testDate = testDate;
public String getTestName()
return testName;
public void setTestName(String testName)
this.testName = testName;
public String getTestResult()
return testResult;
public void setTestResult(String testResult)
this.testResult = testResult;
public String getTestStation()
return testStation;
public void setTestStation(String testStation)
this.testStation = testStation;
public String getTestedItemNumber()
return testedItemNumber;
public void setTestedItemNumber(String testedItemNumber)
this.testedItemNumber = testedItemNumber;
public String getTestedItemRevision()
return testedItemRevision;
public void setTestedItemRevision(String testedItemRevision)
this.testedItemRevision = testedItemRevision;
public String getUnitNumber()
return unitNumber;
public void setUnitNumber(String unitNumber)
this.unitNumber = unitNumber;
public int getTestGroup()
return testGroup;
public void setTestGroup(int testGroup)
this.testGroup = testGroup;
public String getTestMode()
return testMode;
public void setTestMode(String testMode)
this.testMode = testMode;

I use web services a lot and I sympathize with your issue. I
struggle with similar issues and I found this great utility that
will help you confirm if your webservice is returning the data
correctly to Flex. I know you said it works in other applications
but who knows if flex is calling it correctly etc. This utility is
been the most amazing tool in helping me resolve web service
issues.
http://www.charlesproxy.com/
Once you can confirm the data being returned is good you can
try several things in flex. Try changing your result format to
object or e4x etc. See how that plays out. Not sure where your
tapping in to look at your debugger, you might want to catch it
right at the result handler before converting to any collections. .
If nothing here helps maybe post some code to look at. .
.

Similar Messages

  • Marshelling Web Service Response Memory Leak

    I believe I have found a memory leak when using the configuration below.
    The memory leak occurs when calling a web service. When the web service function is marshelling the response of the function call, an "500 Internal Server Error ... java.lang.OutOfMemoryError" is returned from OC4J. This error may be seen via the TCP Packet Monitor in JDeveloper.
    Unfortunately no exception dump is outputted to the OC4J log.
    Configuration:
    Windows 2000 with 1 gig ram
    JDeveloper 9.0.5.2 with JAX/RPC extension installed
    OC4J 10.0.3
    Sun JVM version 1.4.2_03-b02
    To demonstrate the error I created a simple web service and client. See below the client and web service function that demonstrates it.
    The web service is made up of a single function called "queryTestOutput".
    It returns an object of class "TestOutputQueryResult" which contains an int and an array.
    The function call accepts a one int input parameter which is used to vary the size of array in the returned object.
    For small int (less than 100). Web service function returns successfully.
    For larger int and depending on the size of memory configuration when OC4J is launched,
    the OutOfMemoryError is returned.
    The package "ws_issue.service" contains the web service.
    I used the Generate JAX-RPC proxy to build the client (found in package "ws_issue.client"). Package "types" was
    also created by Generate JAX-RPC proxy.
    To test the web service call execute the class runClient. Vary the int "atestValue" until error is returned.
    I have tried this with all three encodings: RPC/Encoded, RPC/Literal, Document/Literal. They have the
    same issue.
    The OutOfMemory Error is raised fairly consistently using the java settings -Xms386m -Xmx386m for OC4J when 750 is specified for the input parameter.
    I also noticed that when 600 is specified, the client seems to hang. According to the TCP Packet Monitor,
    the response is returned. But, the client seems unable to unmarshal the message.
    ** file runClient.java
    // -- this client is using Document/Literal
    package ws_issue.client;
    public class runClient
    public runClient()
    * @param args
    * Test out the web service
    * Play with the atestValue variable to until exception
    public static void main(String[] args)
    //runClient runClient = new runClient();
    long startTime;
    int atestValue = 1;
    atestValue = 2;
    //atestValue = 105; // last one to work with default memory settings in oc4j
    //atestValue = 106; // out of memory error as seen in TCP Packet Monitor
    // fails with default memory settings in oc4j
    //atestValue = 600; // hangs client (TCP Packet Monitor shows response)
    // when oc4j memory sessions are -Xms386m -Xmx386m
    atestValue = 750; // out of memory error as seen in TCP Packet Monitor
    // when oc4j memory sessions are -Xms386m -Xmx386m
    try
    startTime = System.currentTimeMillis();
    Ws_issueInterface ws = (Ws_issueInterface) (new Ws_issue_Impl().getWs_issueInterfacePort());
    System.out.println("Time to obtain port: " + (System.currentTimeMillis() - startTime) );
    // call the web service function
    startTime = System.currentTimeMillis();
    types.QueryTestOutputResponse qr = ws.queryTestOutput(new types.QueryTestOutput(atestValue));
    System.out.println("Time to call queryTestOutput: " + (System.currentTimeMillis() - startTime) );
    startTime = System.currentTimeMillis();
    types.TestOutputQueryResult r = qr.getResult();
    System.out.println("Time to call getresult: " + (System.currentTimeMillis() - startTime) );
    System.out.println("records returned: " + r.getRecordsReturned());
    for (int i = 0; i<atestValue; i++)
    types.TestOutput t = r.getTestOutputResults();
    System.out.println(t.getTestGroup() + ", " + t.getUnitNumber());
    catch (Exception e)
    e.printStackTrace();
    ** file wsmain.java
    package ws_issue.service;
    import java.rmi.RemoteException;
    import javax.xml.rpc.ServiceException;
    import javax.xml.rpc.server.ServiceLifecycle;
    public class wsmain implements ServiceLifecycle, ws_issueInterface
    public wsmain()
    public void init (Object p0) throws ServiceException
    public void destroy ()
    System.out.println("inside ws destroy");
    * create an element of the array with some hardcoded values
    private TestOutput createTestOutput(int cnt)
    TestOutput t = new TestOutput();
    t.setComments("here are some comments");
    t.setConfigRevisionNo("1");
    t.setItemNumber("123123123");
    t.setItemRevision("arev" + cnt);
    t.setTestGroup(cnt);
    t.setTestedItemNumber("123123123");
    t.setTestedItemRevision("arev" + cnt);
    t.setTestResult("testResult");
    t.setSoftwareVersion("version");
    t.setTestConditions("conditions");
    t.setStageName("world's a stage");
    t.setTestMode("Test");
    t.setTestName("test name");
    t.setUnitNumber("UnitNumber"+cnt);
    return t;
    * Web service function that is called
    * Create recCnt number of "records" to be returned
    public TestOutputQueryResult queryTestOutput (int recCnt) throws java.rmi.RemoteException
    System.out.println("Inside web service function queryTestOutput");
    TestOutputQueryResult r = new TestOutputQueryResult();
    TestOutput TOArray[] = new TestOutput[recCnt];
    for (int i = 0; i< recCnt; i++)
    TOArray = createTestOutput(i);
    r.setRecordsReturned(recCnt);
    r.setTestOutputResults(TOArray);
    System.out.println("End of web service function call");
    return r;
    * @param args
    public static void main(String[] args)
    wsmain wsmain = new wsmain();
    int aval = 5;
    try
    TestOutputQueryResult r = wsmain.queryTestOutput(aval);
    for (int i = 0; i<aval; i++)
    TestOutput t = r.getTestOutputResults();
    System.out.println(t.getTestGroup() + ", " + t.getUnitNumber());
    catch (Exception e)
    e.printStackTrace();
    ** file ws_issueInterface.java
    package ws_issue.service;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface ws_issueInterface extends java.rmi.Remote
    public TestOutputQueryResult queryTestOutput (int recCnt) throws java.rmi.RemoteException;
    ** file TestOutputQueryResult.java
    package ws_issue.service;
    public class TestOutputQueryResult
    private long recordsReturned;
    private TestOutput[] testOutputResults;
    public TestOutputQueryResult()
    public long getRecordsReturned()
    return recordsReturned;
    public void setRecordsReturned(long recordsReturned)
    this.recordsReturned = recordsReturned;
    public TestOutput[] getTestOutputResults()
    return testOutputResults;
    public void setTestOutputResults(TestOutput[] testOutputResults)
    this.testOutputResults = testOutputResults;
    ** file TestOutput.java
    package ws_issue.service;
    public class TestOutput
    private String itemNumber;
    private String itemRevision;
    private String configRevisionNo;
    private String testName;
    private String testConditions;
    private String stageName;
    private String testedItemNumber;
    private String testedItemRevision;
    private String unitNumber;
    private String testStation;
    private String testResult;
    private String softwareVersion;
    private String operatorID;
    private String testDate; // to be datetime
    private String comments;
    private int testGroup;
    private String testMode;
    public TestOutput()
    public String getComments()
    return comments;
    public void setComments(String comments)
    this.comments = comments;
    public String getConfigRevisionNo()
    return configRevisionNo;
    public void setConfigRevisionNo(String configRevisionNo)
    this.configRevisionNo = configRevisionNo;
    public String getItemNumber()
    return itemNumber;
    public void setItemNumber(String itemNumber)
    this.itemNumber = itemNumber;
    public String getItemRevision()
    return itemRevision;
    public void setItemRevision(String itemRevision)
    this.itemRevision = itemRevision;
    public String getOperatorID()
    return operatorID;
    public void setOperatorID(String operatorID)
    this.operatorID = operatorID;
    public String getSoftwareVersion()
    return softwareVersion;
    public void setSoftwareVersion(String softwareVersion)
    this.softwareVersion = softwareVersion;
    public String getStageName()
    return stageName;
    public void setStageName(String stageName)
    this.stageName = stageName;
    public String getTestConditions()
    return testConditions;
    public void setTestConditions(String testConditions)
    this.testConditions = testConditions;
    public String getTestDate()
    return testDate;
    public void setTestDate(String testDate)
    this.testDate = testDate;
    public String getTestName()
    return testName;
    public void setTestName(String testName)
    this.testName = testName;
    public String getTestResult()
    return testResult;
    public void setTestResult(String testResult)
    this.testResult = testResult;
    public String getTestStation()
    return testStation;
    public void setTestStation(String testStation)
    this.testStation = testStation;
    public String getTestedItemNumber()
    return testedItemNumber;
    public void setTestedItemNumber(String testedItemNumber)
    this.testedItemNumber = testedItemNumber;
    public String getTestedItemRevision()
    return testedItemRevision;
    public void setTestedItemRevision(String testedItemRevision)
    this.testedItemRevision = testedItemRevision;
    public String getUnitNumber()
    return unitNumber;
    public void setUnitNumber(String unitNumber)
    this.unitNumber = unitNumber;
    public int getTestGroup()
    return testGroup;
    public void setTestGroup(int testGroup)
    this.testGroup = testGroup;
    public String getTestMode()
    return testMode;
    public void setTestMode(String testMode)
    this.testMode = testMode;

    Many thanks for your help.  This solved the issue for our .NET code, however the leak is still present in the report designer.  I was also wondering if you could help further: because of the limits on the java memory process is there a way to ensure that a separate java process is started for each report that is loaded in my report viewers collection?  Essentially the desktop application that i have created uses a tab control to display each type report, so each tab goes through the following code when displaying a report and closing a tab:
    Is there a way to ensure that a different Java process is kicked off each time that I display a different report?  My current code in c# always uses the same Java process so the memory ramps up.  The code to load the report and then dispose of the report through closing the tab (and now the Java process) looks like this:
        private void LoadCrystalReport(string FullReportName)
          ReportDocument reportDoc = new ReportDocument();
          reportDoc.Load(FullReportName, OpenReportMethod.OpenReportByTempCopy);
          this.crystalReportViewer1.ReportSource = reportDoc;
        private void DisposeCrystalReportObject()
          if (crystalReportViewer1.ReportSource != null)
            ReportDocument report = (ReportDocument)crystalReportViewer1.ReportSource;
            foreach (Table table in report.Database.Tables)
              table.Dispose();
            report.Database.Dispose();
            report.Close();
            report.Dispose();
            GC.Collect();
    Thanks

  • Memory leak during insert on PocketPC 2002

    We've built an application using an Oracle Lite 5.0.1 database using an ODBC interface. We've stolen most of the code from:
    C:\OraHome1\Mobile\Sdk\wince\samples\ODBC\sample.cpp
    We've found that there appears to be a memory leak during inserts (haven't fully analyzed updates/gets). The thing leaks roughly X bytes per insert where numBytesInInsertString < X < (2.5 * numBytesInInsertString)
    Has anyone else seen this? It becomes really apparent during out load from XML method where we walk through an xml document and perform roughly 7000 inserts in a row (commit at the end). The memory leak is not coming from the XML stuff, already tested for that.
    Paul Runstedler
    Intrexa Corp.

    I've went back to the sample to confirm my suspicions and sure enough there is memory being leaked. I loaded up the sample workspace in "[ORACLEHOME]\Mobile\Sdk\wince\samples\ODBC" and modified the sample.cpp code ever so slightly. Instead of performing one insert, one update and one select, it performs 5 iterations of 2000 inserts and skips over the updates and deletes. I've placed some memory reporting functionality after each iteration of inserts to report the free memory and this is what I get
    After Connection and creation of table Free: 19742720 Used: 8237056
    After iteration 1, 2000 inserts Free: 19439616 Used: 8540160
    After iteration 2, 2000 inserts Free: 19509248 Used: 8470528
    After iteration 3, 2000 inserts Free: 19439616 Used: 8540160
    After iteration 4, 2000 inserts Free: 19509248 Used: 8470528
    After iteration 5, 2000 inserts Free: 19283968 Used: 8695808
    After commit Free: 19283968 Used: 8695808
    As you can see, there is a loss of about 458700 bytes (about half a meg) over the 5 iterations. Thats about 46 bytes per insert. Not a lot for single insert, but this will eventually cripple any application that wants to perform a high number of inserts.
    Any help would be appreciated.
    Thanks,
    Paul Runstedler
    Intrexa Corp.
    PS: The following is the modified method in sample.cpp
    BOOL CSampleApp::InitInstance()
    COLiteDB db;
    MEMORYSTATUS memInfo;
    CString message;
    if (db.Connect())
    db.Execute (_T ("CREATE TABLE TT (COL1 VARCHAR2(40), COL2 VARCHAR2 (50))"));
    if (*db.GetError())
    AfxMessageBox (db.GetError());
    memInfo.dwLength = sizeof(memInfo);
    GlobalMemoryStatus(&memInfo);
    // Report memory usage
    message.Format( _T("After Connection and creation of table  Free: %d Used: %d\n"),
    memInfo.dwAvailPhys, (memInfo.dwTotalPhys - memInfo.dwAvailPhys));
    TRACE(message);
    CString insertString;
    for( int j = 0; j < 5; j ++ ) {
    for( int i = 0; i < 2000; i ++ ) {
    insertString.Format( _T("INSERT INTO TT VALUES (\'TESTINGTESTING123%d\', \'TEST2ANDBLAJHBLAJBLAJKBJAJAJAJAJJAJAJAJAJA\')") );
    db.Execute (insertString);
    if (*db.GetError()) {
    AfxMessageBox (db.GetError());
    memInfo.dwLength = sizeof(memInfo);
    GlobalMemoryStatus(&memInfo);
    // Report memory usage
    message.Format( _T("After iteration %ld, 2000 inserts  Free: %d Used: %d\n"),
    (j+1), memInfo.dwAvailPhys, (memInfo.dwTotalPhys - memInfo.dwAvailPhys));
    TRACE(message);
    #if 0
    db.Execute (_T ("UPDATE TT SET COL2 = 'TESTING ORACLE LITE' WHERE COL1='TEST1'"));
    if (*db.GetError())
    AfxMessageBox (db.GetError());
    CSQLResult* pres = db.Execute (_T ("SELECT * FROM TT"));
    if (pres != NULL)
    const CRowObj* pobj = pres->Fetch();
    while (pobj)
    CString str = (LPCTSTR)pobj->GetAt (0);
    str += TEXT (" ");
    str += (LPCTSTR)pobj->GetAt (1);
    AfxMessageBox (str);
    pobj = pres->Fetch();
    delete pres;
    #endif
    if( db.Commit() != TRUE ) {
    AfxMessageBox( _T("couldn't commit") );
    memInfo.dwLength = sizeof(memInfo);
    GlobalMemoryStatus(&memInfo);
    // Report memory usage
    message.Format( _T("After commit  Free: %d Used: %d\n"),
    memInfo.dwAvailPhys, (memInfo.dwTotalPhys - memInfo.dwAvailPhys));
    TRACE(message);
         // Since the dialog has been closed, return FALSE so that we exit the
         // application, rather than start the application's message pump.
         return FALSE;
    }

  • How to use a Web Service Response

    In the snps_users documentation it seems to be really easy but in fact...
    After invoking my web service I retrieve a XML file which is my response then we would like to use it.
    As written in the documentation I Export Response in XSD file, I create my XML Model but How to reverse the XSD ???
    There's 4 references to XSD into all the snps_users documentation but no one talking about.
    Moreover it's written See Creating and Reverse-Engineering a
    Model for an XML file for more information and that's what I'm doing but no way...
    So without the XSD I m trying to use the Response file like an XML file but I always have an error which looks like :
    java.sql.SQLException: No root found in the DTD file
    The Web Service Response XML File use NameSpace could the problem come from here ???
    If someone ever use it ...
    Thanks in advance.
    BM

    When I specify the XSD It raises another error,
    my URL is :
    jdbc:snps:xml?f=C:/Temp/File.xml&d=C:/Temp/File.xsd&s=REPON&nspg=xml
    Error message:
    java.sql.SQLException: A SAXException was caught while reading the model saying [Element value has no type]
    The XSD and the XML are generated by ODI after invoking a Web Service...
    Any idea ???

  • Web service response processing inside a BPM

    Hi Experts,
    Please can you let me know if it is possible to achieve the following inside a BPM:
    u2022     Once you getting the web service  SOAP response, determine if itu2019s a SOAP fault or a normal web service response.
    u2022     If itu2019s a SOAP fault, create a retry loop with a wait step inside the BPM to try and retry the process (perhaps 5 times in 1 minute intervals).
    u2022     After the retry intervals, if the message is still in a failed step, force the BPM to go into an error state
    u2022     If the Web Service returns a normal response, log the response inside a database table and end the BPM
    If it is possible, please can you provide an example?
    Thank you,
    Brendon

    Hi
    Have you found the workaround?
    Sorry for refreshing topic. Flag mustUnderstand ='1' in response is unussual thing.
    BR

  • Web service response contains SOAP Headers with "mustUnderstand" true

    Hi
    I have a requirement where in I have to consume a web service as adaptive web service model, and while executing the service pass a mandatory parameter to the soap header. We are able to set the mandatory parameter to the soad header. We got the code snippet to do this from a wiki link
    http://wiki.sdn.sap.com/wiki/display/WDJava/FAQ-Models-AdaptiveWebService#FAQ-Models-AdaptiveWebService-WhatarethefunctionalgapsofthecurrentAdpativeWSModelImporter%3F
    On executing the service now through web dynpro we are getting the below error
    "Web service response contains SOAP Headers with "mustUnderstand" true which are not handled by the client runtime"
    Any thoughts on how to handle this mustUnderstand attribute with some code snippet? Appreciate all help.
    Thanks,
    KN.

    Hi
    Have you found the workaround?
    Sorry for refreshing topic. Flag mustUnderstand ='1' in response is unussual thing.
    BR

  • Set listbox items from web service response

    Hi All
    I am trying to set list box items from a web service response. Couple of issues over here:
    1. The user should be able to select multiple items from the list. Hence if I set "Allow multiple values" and set Commit on "exit", then after the web service returns the output, no data is displayed in the listbox. I need to click inside the list box to see the data returned by the web service. How to overcome this..??  ( However this problem (clicking inside the listbox to see the items) does not exist if "Allow multiple values" is unchecked and Commit is set on "Select". )
    2. After the list box is filled up, certain default values should be selected. This selection is based on one of the response field (which is actually a table with multiple values... ). Hence, how to capture this response field and set the default values in the above list..??
    3. The same case for a dropdown. The values are visible in dropdown. However, a default value should be selected and displayed after returning a response from web service. Again, this default value is dependant on another field in the response as in point no.2
    I am trying to use postExecute event as described in [this|http://forms.stefcameron.com/2009/03/23/pre-process-web-service-responses/] link...however not able to achieve the functionality. Please provide suggestions / inputs.
    Thanks
    Deepak

    Hello,
    first: I don´t know anything about the right solution. I am unaware of the existence of the solution, because there were quite many of question about this multiple selection problem and I don´t remember a single "answer".
    I can recommend you to simplify everything and create the functionality yourself. I have done that before to avoid these "Adobe-standard" problems. If you have a problem with autofill of the object, ask your WS to send you a single string and pass it yourself using scripting (JS).
    And if you have problems with multiple selection, create your own field/ object. Get the string of values, parse it, create multiple lines of the dynamic table with some suitable tool to check/ select the rows you need (use checkbox for example, and your text as a table row). This way you can selected anything you want with no problems at all. It wil only cost you some extra work.
    Regards, Otto

  • Retrieve error message of SAP provided web service in web service response

    Hi All,
    We have a SAP provided web service that sometimes fails to process data it is called with. This is not a problem as the data sometimes is just plain wrong (i.e. date field contains text). However, the error is only logged in SAP and can only be queried using SRT_UTIL.
    The problem is that the error is not reported back via the response. How can we set up the web service so that the error could be displayed by the calling party without logging into SAP?
    Thanks for the help in advance.
    Best Regards,
    Daniel

    Hi Calvin,
    The WS is indeed synchronous. The problem is not whether the error is captured or not. It is captured indeed but it is logged inside SAP only and not returned via the Web Service response mechanism. The error message says that error message can be retrieved using SRT_UTIL.
    This is a major problem as the users of the outside system calling SAP have no right to use SRT_UTIL to track down the error. They need to contact SAP basis in order to get to the end of it.
    What we need to achieve is to get back the same error message that can be seen with SRT_UTIL via the web service.
    Thanks.

  • Custom MediaStreamSource and Memory Leaks During SampleRequested

    Greetings,
    I have a nasty memory leak problem that is causing me to pull my hair out.
    I'm implementing a custom MediaStreamSource along with MediaTranscoder to generate video to disk. The frame generation operation occurs in the SampleRequested handler (as in the MediaStreamSource example). No matter what I do - and I've tried a
    ton of options - inevitably the app runs out of memory after a couple hundred frames of HD video. Investigating, I see that indeed GC.GetTotalMemory reports an increasing, and never decreasing, amount of allocated RAM. 
    The frame generator in my actual app is using RenderTargetBitmap to get screen captures, and is handing the buffer to MediaStreamSample.CreateFromBuffer(). However, as you can see in the example below, the issue occurs even with a dumb allocation
    of RAM and no other actual logic. Here's the code:
    void _mss_SampleRequested(Windows.Media.Core.MediaStreamSource sender, MediaStreamSourceSampleRequestedEventArgs args)
    if ( args.Request.StreamDescriptor is VideoStreamDescriptor )
    if (_FrameCount >= 3000) return;
    var videoDeferral = args.Request.GetDeferral();
    var descriptor = (VideoStreamDescriptor)args.Request.StreamDescriptor;
    uint frameWidth = descriptor.EncodingProperties.Width;
    uint frameHeight = descriptor.EncodingProperties.Height;
    uint size = frameWidth * frameHeight * 4;
    byte[] buffer = null;
    try
    buffer = new byte[size];
    // do something to create the frame
    catch
    App.LogAction("Ran out of memory", this);
    return;
    args.Request.Sample = MediaStreamSample.CreateFromBuffer(buffer.AsBuffer(), TimeFromFrame(_FrameCount++, _frameSource.Framerate));
    args.Request.Sample.Duration = TimeFromFrame(1, _frameSource.Framerate);
    buffer = null; // attempt to release the memory
    videoDeferral.Complete();
    App.LogAction("Completed Video frame " + (_FrameCount-1).ToString() + "\n" +
    "Allocated memory: " + GC.GetTotalMemory(true), this);
    return;
    It usually fails around frame 357, with GC.GetTotalMemory() reporting 750MB allocated.
    I've tried tons of work-arounds, none of which made a difference. I tried putting the code that allocates the bytes in a separate thread - no dice.  I tried Task.Delay to give the GC a chance to work, on the assumption that it just had no time
    to do its job. No luck.
    As another experiment, I wanted to see if the problem went away if I allocated memory each frame, but never assigned it to the MediaStreamSample, instead giving the sample (constant) dummy data. Indeed, in that scenario, memory consumption stayed
    constant. However, while I never get an out-of-memory exception, RequestSample just stops getting called around frame 1600 and as a result the transcode operation never actually returns to completion.
    I also tried taking a cue from the SDK sample which uses C++ entirely to generate the frame. So I passed the buffer as a Platform::Array<BYTE> to a static Runtime extension class function I wrote in C++.
    I won't bore you with the C++ code, but even directly copying the bytes of the array to the media sample using memcpy still had the same result! It seems that there is no way to communicate the contents of the byte[] array to the media sample without
    it never being released.
    I know what some will say: the difference between my code and the SDK sample, of course, is that the SDK sample generates the frame _entirely_ in C++, thus taking care of its own memory allocation and deallocation. Because I want to get
    the data from RenderTargetBitmap, this isn't an option for me. (As a side note, if anyone knows if there's a way to get the contents of an RT Window using DirectX, that might work too, but I know this is not a C++ forum, so...). But more importantly,
    MediaStreamSource and MediaStreamSample are managed classes that appear to allow you to generate custom frames using C# or other managed code. The MediaStreamSample.CreateFromBuffer function appears to be tailored for exactly what I want. But there appears
    to be no way to release the buffer when giving the bytes to the MediaStreamSample. At least none that I can find.
    I know the RT version of these classes are new to Windows 8.1, but I did see other posts going back 3 years discussing a similar issue in Silverlight. That never appears to have been resolved.
    I guess the question boils down to this: how do I safely get managed data, allocated during the SampleRequested handler, to the MediaStreamSample without causing a memory leak? Also, why would the SampleRequested handler just stop getting called
    out of the blue, even when I artificially eliminate the memory leak problem?
    Thanks so much for all input!

    Hi Rob - 
    Thanks for your quick reply and for clarifying the terminology. 
    In the Memory Usage test under Analyze/Performance and Diagnostics (is that what you mean?) it's clear that each frame of video being created is not released from memory except when memory consumption gets very high. GC will occasionally kick in, but eventually
    it succumbs.
    Interestingly, if I reduce the frame size substantially, say 320x240, it never runs out of RAM no matter how many frames I throw at it. The Memory Usage test, however, shows the same pattern. But this time the GC can keep up and release the RAM.
    After playing with this ad nauseum,  I am fairly convinced I know what the problem is, but the solution still escapes me. It appears that the Transcoder is requesting frames from the MediaStreamSource (and the MediaStreamSource is providing them via
    my SampleRequested handler) faster than the Transcoder can write them to disk and release them. Why would this be happening? The MediaStreamSource.BufferTime property is - I thought - used to prevent this very problem. However, changing the BufferTime seems
    to have no effect at all - even changing it to ZERO doesn't change anything. If I'm right, this would explain why the GC can't do its job - it can't release the buffers I'm giving to the Transcoder via SampleRequested because the Transcoder won't give them
    up until it's finished transcoding and writing them to disk. And yet the transcoder keeps requesting samples until there's no more memory to create them with.
    The following code, which I made from scratch to illustrate my scenario, should be air-tight according to everything I've read. And yet, it still runs out of memory when the frame size is too large. 
    If you or anyone else can spot the problem in this code, I'd be thrilled to hear it. Maybe I'm omitting a key step with regard to getting the deferral? Or maybe it's a bug in the back-end? Can I "slow down" the transcoder and force it to release samples
    it's already used?
    Anyway here's the new code, which other than App.cs is everything. So if I'm doing something wrong it will be in this module:
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Threading.Tasks;
    using System.Linq;
    using System.Runtime.InteropServices.WindowsRuntime;
    using System.Diagnostics;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Popups;
    using Windows.Storage;
    using Windows.Storage.Pickers;
    using Windows.Storage.Streams;
    using Windows.Media.MediaProperties;
    using Windows.Media.Core;
    using Windows.Media.Transcoding;
    // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
    namespace MyTranscodeTest
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    MediaTranscoder _transcoder;
    MediaStreamSource _mss;
    VideoStreamDescriptor _videoSourceDescriptor;
    const int c_width = 1920;
    const int c_height = 1080;
    const int c_frames = 10000;
    const int c_frNumerator = 30000;
    const int c_frDenominator = 1001;
    uint _frameSizeBytes;
    uint _frameDurationTicks;
    uint _transcodePositionTicks = 0;
    uint _frameCurrent = 0;
    Random _random = new Random();
    public MainPage()
    this.InitializeComponent();
    private async void GoButtonClicked(object sender, RoutedEventArgs e)
    Windows.Storage.Pickers.FileSavePicker picker = new Windows.Storage.Pickers.FileSavePicker();
    picker.FileTypeChoices.Add("MP4 File", new List<string>() { ".MP4" });
    Windows.Storage.StorageFile file = await picker.PickSaveFileAsync();
    if (file == null) return;
    Stream outputStream = await file.OpenStreamForWriteAsync();
    var transcodeTask = (await this.InitializeTranscoderAsync(outputStream)).TranscodeAsync();
    transcodeTask.Progress = (asyncInfo, progressInfo) =>
    Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
    _ProgressReport.Text = "Sourcing frame " + _frameCurrent.ToString() + " of " + c_frames.ToString() +
    " with " + GC.GetTotalMemory(false).ToString() + " bytes allocated.";
    await transcodeTask;
    MessageDialog dialog = new MessageDialog("Transcode completed.");
    await dialog.ShowAsync();
    async Task<PrepareTranscodeResult> InitializeTranscoderAsync (Stream output)
    _transcoder = new MediaTranscoder();
    _transcoder.HardwareAccelerationEnabled = false;
    _videoSourceDescriptor = new VideoStreamDescriptor(VideoEncodingProperties.CreateUncompressed( MediaEncodingSubtypes.Bgra8, c_width, c_height ));
    _videoSourceDescriptor.EncodingProperties.PixelAspectRatio.Numerator = 1;
    _videoSourceDescriptor.EncodingProperties.PixelAspectRatio.Denominator = 1;
    _videoSourceDescriptor.EncodingProperties.FrameRate.Numerator = c_frNumerator;
    _videoSourceDescriptor.EncodingProperties.FrameRate.Denominator = c_frDenominator;
    _videoSourceDescriptor.EncodingProperties.Bitrate = (uint)((c_width * c_height * 4 * 8 * (ulong)c_frDenominator) / (ulong)c_frNumerator);
    _frameDurationTicks = (uint)(10000000 * (ulong)c_frDenominator / (ulong)c_frNumerator);
    _frameSizeBytes = c_width * c_height * 4;
    _mss = new MediaStreamSource(_videoSourceDescriptor);
    _mss.BufferTime = TimeSpan.FromTicks(_frameDurationTicks);
    _mss.Duration = TimeSpan.FromTicks( _frameDurationTicks * c_frames );
    _mss.Starting += _mss_Starting;
    _mss.Paused += _mss_Paused;
    _mss.SampleRequested += _mss_SampleRequested;
    MediaEncodingProfile outputProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Ntsc);
    outputProfile.Audio = null;
    return await _transcoder.PrepareMediaStreamSourceTranscodeAsync(_mss, output.AsRandomAccessStream(), outputProfile);
    void _mss_Paused(MediaStreamSource sender, object args)
    throw new NotImplementedException();
    void _mss_Starting(MediaStreamSource sender, MediaStreamSourceStartingEventArgs args)
    args.Request.SetActualStartPosition(new TimeSpan(0));
    /// <summary>
    /// This is derived from the sample in "Windows 8.1 Apps with Xaml and C# Unleashed"
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="args"></param>
    void _mss_SampleRequested(MediaStreamSource sender, MediaStreamSourceSampleRequestedEventArgs args)
    if (_frameCurrent == c_frames) return;
    var deferral = args.Request.GetDeferral();
    byte[] frameBuffer;
    try
    frameBuffer = new byte[_frameSizeBytes];
    this._random.NextBytes(frameBuffer);
    catch
    throw new Exception("Sample source ran out of RAM");
    args.Request.Sample = MediaStreamSample.CreateFromBuffer(frameBuffer.AsBuffer(), TimeSpan.FromTicks(_transcodePositionTicks));
    args.Request.Sample.Duration = TimeSpan.FromTicks(_frameDurationTicks);
    args.Request.Sample.KeyFrame = true;
    _transcodePositionTicks += _frameDurationTicks;
    _frameCurrent++;
    deferral.Complete();
    Again, I can't see any reason why this shouldn't work. You'll note it mirrors pretty closely the sample in the Windows 8.1 Apps With Xaml Unleashed book (Chapter 14). The difference is I'm feeding the samples to a transcoder rather than a MediaElement (which,
    again should be no issue).
    Thanks again for any suggestions!
    Peter

  • Memory leaks during child window close

    Hi All,
       We have a tool that generates code for WPF application. In one of the applications WPF main window displays a child window in the form of a tab. The main window here can hold multiple child windows. I did a small test. I opened main window and
    took memory snapshot with the help of .Net memory profiler. Opened child window and closed it immediately. I took snapshot again and compared with the previous one. To my surprise , many new objects/collections have been active in the heap and due to this
    memory consumption got increased almost exponentially.  If I open and close more and more child windows then memory consumption is keep on increasing.
    During child window close , I am performing all the clean up like clearing all collections , hashmaps etc. As per the suggestions mentioned in forums , I am taking care of cleaning up all the members data like DispatcherTimer , unregistering event handlers
    etc. But still memory is not being freed up even after closing the child window. As per the profiler output most of the memory has been occupied by Hashtable , Hastable.bucket[]. Profiler even reported few pinned instances as well but it looks everything is
    evident from framework API not from my code. I could see styles, controltemplates , System resources etc as active and reachable objects.
    I am just wondering am I getting affected by framework flaws or could there be anything I can do in my source to get rid of this memory leak. Request your comment and appreciate your help on this.
    Thanks,
    Brahmaji.

    Hi ,
     Thanks for the response. Basically I first opened parent panel which is of type Window. It included menu , toolbar etc. For menu/toolbar events it opens child windows which gets displayed in main window in the form of tabs. This is my use case.
    I tried the suggested profiler Redgate Ants profiler. Its very good and informative! I ran the profiler
    got the following output. Though I closed the child window it seems objects are still there in memory . No where I left out string , byte array objects in my code.
    Not sure why Runtimemethodinfo , hastable bucket are there in memory. I even tried the workaround mentioned at here.
    I thought panel resources might have not been freed up and in my code I am clearing them as well. Still did not see much improvement. Any additional things do I need to check? Please let me know.
    Thanks,
    Brahmaji.

  • Memory leaks continuing in Safari and Web Kit

    Will Apple ever fix the Safari memory leak?
    As many of you know lots of reports over the years of Safari & Webkit having problems with memory leaks, and haven't seen a fix to it yet. This is a very important factor for usability of Safari.
    A memory leak is when, after a period of time, your browser, which is the online field that's designed to function like a page and is used to access web pages and surf the World Wide Web, consumes more and more of your computer's memory until it reaches a point where it literally becomes impossible to use your computer. It's like your computer's stuck in cyber mud. You have to close any open software program or restart the entire computer.
    Safari starts about 426.9 MB of real memory and 412.6 MB of virtual memormy and can go up to 1Gb of memory.
    Has anyone come up with a fix to this problem ? If anyone has a workaround for this, please share it.
    Meanwhile, Apple really should eliminate this problem once and for all.
    FYI, I'm using Safari version 5.0.3 and the latest WebKit r72487 which was built on 21 November 2010.

    My experience is that the same thing happens with Firefox and Chrome. The only difference with Chrome is that since the tabs are separate threads, they consume memory separately. The nice thing about that is that once the tab is closed memory is instantly freed. However, the helper thread always gets larger. Whether this is a memory leak or a consequence of having an application open over a long period of time is -I believe- open to discussion. I have experienced similar results with Eclipse (a memory intensive application). Daily shutdown/reboot and a few "Quit"s per a few hours fixes this issue. I don't know whether you would like to do this, though.
    Using Safari 5.0.2.

  • Memory Leak During Spatial Query

    Platform:
    Oracle 8.1.7 EE with Spatial
    Windows NT 4.0
    I'm seeing a memory leak that I have determined has something to do with spatial. Here is the PL/SQL code that generates the leak:
    DECLARE
    v_id NUMBER(16);
    v_longitude NUMBER(15,10);
    v_latitude NUMBER(15,10);
    v_wirecenter_name VARCHAR2(11);
    CURSOR c_Source IS
    SELECT id, longitude, latitude
    FROM prospects_geocode_info;
    CURSOR c_WC IS
    SELECT wc.wirecenter_name
    FROM ion_info.ion_wirecenters wc
    WHERE mdsys.sdo_relate(wc.geoloc,
    mdsys.sdo_geometry(2001,
    8265,
    mdsys.sdo_point_type(v_longitude,
    v_latitude,
    NULL),
    NULL,
    NULL),
    'mask=contains querytype=window') = 'TRUE';
    BEGIN
    open c_Source;
    loop
    fetch c_Source into v_id, v_longitude, v_latitude;
    exit when c_Source%NOTFOUND;
    if v_longitude is not NULL and v_latitude is not NULL THEN
    open c_WC;
    loop
    fetch c_WC into v_wirecenter_name;
    exit when c_WC%NOTFOUND;
    end loop;
    close c_WC;
    end if;
    end loop;
    close c_Source;
    END;
    I'm attributing the link to spatial because if I change the c_WC cursor's SELECT statement to not use a spatial query, I get no leak. As near as I can tell I'm leaking a little bit of memory with each spatial query. I can watch the consumed memory jump in 64K blocks about every second or two on the machine I am running on.
    I have tried pinning the code in memory, as well as pinning the spatial index and it's table in memory. None of this helps. I am continuing to experiment with this, but wanted to see if anyone had any ideas.
    Thanks.
    Matt.

    I have been able to reproduce the memory leak now using a very simple anonymous PL/SQL block. All it is doing is looping through a range of lon/lat and issuing a given spatial query. Here it is:
    DECLARE
    v_longitude NUMBER(15,10) := 0;
    v_latitude NUMBER(15,10) := 0;
    v_miprinx NUMBER;
    v_lon_start NUMBER(15,10) := -150.0000000000;
    v_lon_end NUMBER(15,10) := -30.0000000000;
    v_lat_start NUMBER(15,10) := 20.0000000000;
    v_lat_end NUMBER(15,10) := 70.0000000000;
    CURSOR c_test IS
    SELECT mi_prinx
    FROM ion_info.ion_markets
    WHERE mdsys.sdo_relate(geoloc,
    mdsys.sdo_geometry(2001,
    8265,
    mdsys.sdo_point_type(v_longitude,
    v_latitude,
    NULL),
    NULL,
    NULL),
    'mask=contains querytype=window') = 'TRUE';
    BEGIN
    FOR v_longitude IN v_lon_start..v_lon_end LOOP
    FOR v_latitude IN v_lat_start .. v_lat_end LOOP
    OPEN c_test;
    LOOP
    FETCH c_test
    INTO v_miprinx;
    EXIT WHEN c_test%NOTFOUND;
    END LOOP;
    CLOSE c_test;
    END LOOP;
    END LOOP;
    END;
    On my 8.1.7 database on NT 4.0 I get the same results on all three tables that have spatial indexes. I tried this on a different spatial table on 8.1.6 on NT 4.0 and saw no memory leak. It doesn't matter whether I execute the script using sqlplus or sqlplusw.
    Matt.

  • Memory leak during copyPixels

    Hi,
    I am making a custom renderer using the copyPixels function for my
    Haxe/Flash game. So I have this kind of code :
    buffer.bitmapData.copyPixels(m_CurrentSkin, RECT3, POINT, null, null,
    true);
    where :
    -buffer is the bitmap where all my scene's objects are drawn
    -m_CurrentSkinis the BitmapData that contains the current frame of the
    object to be drawn
    Every time m_CurrentSkin contains a BitmapData that have never been
    drawn (the first time that an animation frame is drawn for example), I
    have a memory leak that is not garbage.
    However if m_CurrentSkin contains a BitmapData that have already been
    drawn (when the animation is played a second time for example), there
    isn't any memory leak.
    If I comment this line there is no leak so the problem comes from
    there.
    It seems that a copy of the BitmapData is cached in memory but I have
    checked in my code and there is no cacheAsBitmap explicitely set to
    true.
    Anyone have idea of what is happening?
    Thank you,
    Régis.

    How do you know it's leaking? As I copyPixels and watch the profile in FlashBuilder I see flash caching and it doesn't garbage collect until it feels it's necessary. If it continuously acceesses the same thing it's not behaving improper to continuously keep it in cache.
    That being said, if you press the manual garbage collection button and don't see it release within a few seconds, it might be a leak. The only way you'll really know is to isolate this, clear the bitmapdata objects and null them out while pressing garbage collection to see if flash properly disposes of the bitmapdata instances. Just make sure you're disposing of them properly.

  • Memory Leak during EAR stop/update/start

    Hi all,
    Excuse me if I'm putting this question in the wrong forum - not sure if it should be here or "EJB". That being said - I am working on a project which is using Weblogic 11g and we have a set of EARs with EJBs deployed out. In one EJB we have a static variable which holds onto an object which is rather large (~2 Gigs).
    What I've noticed is that if I stop the EAR containing that EJB, update and restart it without restarting the server it's running on, the memory of that object does not seem to get GC'd. So basically, every time we make changes to that EAR and want to deploy we end up eating up a lot of memory.
    Our current way to fix this is to add a @pre-destroy method which basically does a "largeObject = null". This seems to allow it to be marked and collected by the Garbage Collector. However, I don't think this is the best solution for all static objects (what happens if we have an a bunch of EJBs in the pool and the AppContainer destroys one - all static references will get removed right?).
    Is there a reason that the AppContainer is holding on to those static references? Or am I missing something?
    Thanks,
    -Ritter

    An object referenced by a static member variable is strongly referenced until the class is unloaded. A normal classloader
    never unloads a class, but on an application server, such as WebLogic, this sometimes happens under the right conditions.
    A class in Java can be garbage-collected when nothing references it. In most simple setups this never happens, but there are situations where it can occur.
    There are many ways to make a class reachable and thus prevent it from being eligible for GC:
    - objects of that class are still reachable.
    - the Class object representing the class is still reachable
    - the ClassLoader that loaded the class is still reachable
    - other classes loaded by the ClassLoader are still reachable
    When none of those are true, then the ClassLoader together with all classes it loaded are eligible for GC.
    The best way to proceed is not to use global variables (which is asking for tricky memory leaks), especially ones that are 2G.

  • Out of memory when coverting large files using Web service call

    I'm running into an out of memory error on the LiveCycle server when converting a 50 meg Word document with a Web service call.  I've already tried increasing the heap size, but I'm at the limit for the 32 bit JVM on windows.  I could upgrade to a 64 bit JVM, but it would be a pain and I'm trying to avoid it.  I've tried converted the 50 meg document using the LiveCycle admin and it works fine, the issue only occurs when using a web service call.  I have a test client and the memory spikes when it's generating the web service call taking over a gig of memory.  I assume it takes a similar amount of memory on the receiving end which is why LiveCycle is running out of memory.  Does any one have any insight on why passing over a 50 meg file requires so much memory?   Is there anyway around this?
    -Kelly

    Hi,
    You are correct that a complete 64bit environment would solve this. The problem is that you will get the out of memory error when the file is written to memory on the server. You can solve this by creating an interface which stores large files on the server harddisk instead, which allows you to convert as large files as LC can handle without any memory issue.

Maybe you are looking for

  • How to call a Sub template in BI Publisher for the same Loop

    Hi, I'm trying to achieve a multi template invoice customer facing Report output by using sub templates in BI publisher. I've stored the Template2.rtf file in Local machine temp directory and calling it in the main RTF. My Scenario is as described be

  • FBL5N --customer line item report

    Dear all, our clients want to see "customer name" in FBL5N report, vendor name in FBL1N by each line items when selecting  all customers or vendors . I wonder how you guys could make it possible to meet this requests? Sincerely, J.

  • Music folder

    All right.  I have 2 (maybe 3) iTunes folder layouts in my Music DIR. I have clicked keep it organized and copy into... iTunes      Album Artwork      iTunes Media           Artists  - and album and songs subfolders  <--           Audio Books        

  • Accessing a loaded swf

    I'm using this code to bring in another swf into a movieClip called "movieLoader": var myLoader:Loader = new Loader(); movieLoader.addChild(myLoader); var urlMovie:URLRequest = new URLRequest("movie1.swf"); myLoader.load(urlMovie); The movie loads ju

  • Question re 6120 classic Address & Contact format

    Help help help please help. When opening address book & using Alpha key to locate contact,the menu assumes that you want the surname first ? not the first name in the memory. To me this doesn't make sense. I can't work out how to change this format.