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.

Similar Messages

  • 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;
    }

  • 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 Leak with Tomcat version update 3.2 to 6.0

    Hi, I've been trying to update tomcat from 3.2 to 6.0. My issue is that I have a memory leak(s?) that make the web application unusable. Currently in my setup I am using these components:
    Tomcat 6.0, sun JDK 1.6.0_01, mssql 2005, Microsoft SQL Server 2005 JDBC Driver 1.2, xalan 2.7.0, log4j 1.0.4 (should be only out of date component)
    It is a fairly large application that uses xslt with xalan and java servlets to display web pages. There was no issue with memory leaks before the update from tomcat 3.2, sun jdk 1.4.2 and old xalan and jdbc (for mssql 2000) components.
    My question for the community is, where should I be looking for my memory leak. Are there known issues with my setup?
    thanks for your help,
    Matt

    Just in case someone goes down the same road as me, my problem was actually the one listed on the page below. My threads are not being released after a StandardContext reload. Which I'm not sure if this leak applies to tomcat version <4 or not.
    http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?pageId=2669

  • 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.

  • 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. .
    .

  • 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.

  • JVM - Microsoft JScript.dll Memory Leak when using Java Web Start

    I have posted before a topic related to this matter, although now I have a lot more information about what is going on (although still no fix for it). This is the link to the earlier post, containing JVM HOTSPOT EXCEPTION_ACCESS_VIOLATION
    http://forum.java.sun.com/thread.jspa?threadID=5116970&messageID=9402346#9402346
    The issue is that after deploying on Windows XP a multi threaded, memory consuming (40 Mb) Java Swing application using Java Web Start, and the standard web page (IE6) reference to the jnlp file to launch the installation from Tomcat, each time this application gets executed by double clicking on the desktop icon (with no IE6 interaction at all), calls start being made between jvm.dll (sun) and jscript.dll (Microsoft IE), these interactions never release the memory they consume, so after a period of using the application it crashes unavoidably. If I execute exactly the same application launching it from command line (no Web Start nor IE6 browser involved), the application works nicely all the time, no problem at all.
    My question is: does anyone know why these calls to jscript.dll are even being made during web start application execution? As said, it's a desktop Swing app, it does not need the browser at all, and jscript.dll is a IE dll. Anyone can advice on how these interactions can be eliminated?
    I've worked with Microsoft support for two weeks on this issue and all they have said is that it is a Sun problem and they can not help further.
    Thanks
    Jes�s

    Microsoft suggested (among others) two test.
    1- Install IE7 and run the application
    2-Install Firefox and run the application
    Results were:
    For 1: The application does not crash, apparently IE7 has a newer version of Jscript.dll that, in Microsoft words, handles better 'bad software', refering to 'bad software' to the java virtual machine I guess. Looking at the performance manager you can see memory goes down as with IE6, but at some point memory is released and the app. does not crash. Anyway is still is uncertain to me why Jscript.dll is getting involved at all. Although this solves the problem is not a viable solution for us, because I work in a corporation where changes such as upgrading the IE version on a large number of desktop can not be justified just because one app. is crashing, and it would take a long validation time anyway before the upgrade can proceed.
    For 2: I did install Firefox in a machine and the application still crashed, but it is true I did not uninstall IE6, so the conflictive Jscript.dll was still sitting at system32. Quite possibly the crash would not happen if that dll wasn't there at all.
    Thanks
    Jes�s

  • Firefox has a memory leak and I need to update it, but I want to keep 3.5 because I don't like how the newest version of Firefox is set up.

    My computer is running low on RAM, and when I look at what processes are using the most memory, firefox is the number one using between 28,000 to 93,000k, so I'm guessing that it has a memory leak.
    And because of that memory leak I have to update firefox, however I really dislike the newest version of firefox and I'd prefer to stick with the version I have, which is 3.5.

    Often the memory problems are not just from Firefox in isolation, but partly relating to all the extensions available for it and then the videos and animations it runs on media rich sites.
    The first thing to do is to upgrade to firefox 3.6 which is at least a supported version (Maybe not for much longer)
    * see [[updating firefox]]
    Next version after 3.6 is 4, you should avoid that, it did have some memory problems, that were worse than 3,6 and firefox 4 is no longer secure or supported.
    The techies at Firefox have been working on memory problems recently and have made many improvements, but some of these improvements are only seen in the trial versions of Firefox.
    I would in fact suggest you upgrade to Firefox 5 the current release version (soon to be replaced with Firefox 6)
    I am able to run Firefox v3.6 to v8 on legacy XPs with less than 1GB RAM. Firefox in itself is not necessarily very demanding in terms of RAM. I am not sure what the figures are you are quoting, or whether they are high. ( Note 1Gb is in the order of 1 000 000 k )
    As for not liking the set-up of new versions of Firefox, there is quite abit that can be changed, maybe you would be able to configure it more to your liking with little effort.

  • Memory Leak With Spatial queries

    We are using 8.1.6 on NT (4.0) for spatial data queries. We are facing memory leak problems. At the starting our job will run very fast and after some time it will start slipping. I'm monitoring PGA size from v$sessionstat/v$sysstat and it is regularly increasing. Same is the case for memory on NT machine when I'm monitoring thru performance monitor. I have already applied the spatial patch available for 8.1.6 but no improvement.
    Please let me know If there is any workaround. When I'm submitting my job in parts and shutdown the database in between then It is releasing all the memory and It is working fine. Without shutting the database it is not relasing the memory even though I stop my spatial data batch job.
    null

    Hi,
    Thanks for your responses.
    This is the query:
    SELECT a.geo_id, mdsys.sdo_geom.sdo_length(
    mdsys.sdo_cs.transform(
    mdsys.sdo_geometry(2002, 8307, null,
    mdsys.sdo_elem_info_array(1,2,1),
    mdsys.sdo_ordinate_array(' &#0124; &#0124;
    longi &#0124; &#0124;
    ', ' &#0124; &#0124;
    lati &#0124; &#0124;
    a.geo_geometry.sdo_point.x,
    a.geo_geometry.sdo_point.y )),
    mdsys.sdo_dim_array(mdsys.sdo_dim_element(' &#0124; &#0124;
    '''' &#0124; &#0124;
    'X' &#0124; &#0124;
    '''' &#0124; &#0124;
    ',-180,180, .00000005),
    mdsys.sdo_dim_element(' &#0124; &#0124;
    '''' &#0124; &#0124;
    'Y' &#0124; &#0124;
    '''' &#0124; &#0124;
    ',-90,90, .00000005)), 41004),
    .00000005) * 6.213712e-04 distance_in_miles
    FROM ' &#0124; &#0124;
    t_name &#0124; &#0124;
    ' a
    WHERE mdsys.sdo_nn(a.geo_geometry,
    mdsys.sdo_geometry(1, 8307,
    mdsys.sdo_point_type(' &#0124; &#0124;
    longi &#0124; &#0124;
    ', ' &#0124; &#0124;
    lati &#0124; &#0124;
    ', null),
    null, null),' &#0124; &#0124;
    '''' &#0124; &#0124;
    'SDO_NUM_RES=5' &#0124; &#0124;
    '''' &#0124; &#0124;
    ') = ' &#0124; &#0124;
    '''' &#0124; &#0124;
    'TRUE' &#0124; &#0124;
    '''' &#0124; &#0124;
    AND a.geo_id ' &#0124; &#0124;
    filter &#0124; &#0124;
    ORDER BY 2;
    Here we are passing the tname and filter dynamically based on certain conditions and the memory leak is almost 100K to 200K per query.
    First I tried to closing the session only but that didn't work. Database shutdown is only able to release the memory. I'm monitoring v$sysstat/v$sesstat and size of oracle.exe in NT performance monitor. Please let me know If something else need to be monitor.
    Thanks.
    Sandeep
    null

  • Memory Leak with 10.6.4

    This is very unusual for my Mab Desktops to do, but all I can figure is that there is a memory leak in the latest update 10.6.4 and that it is effecting everything.
    I ran a few apps on Friday night, closed then down but left the computer running. This morning, I tried the same apps and they would'nt load. I had to restart the computer to get them to work. The same thing happened on Thursday. I've fixed permissions so I can rule that out, unless of course it's the RAM it's self but I've ran tests on that and the software says that it's ok.
    Any suggestions would be appreciated on this subject.

    Can you open them, close them, and then immediately reopen them?
    Are they crashing or just bouncing in the Dock and never opening?
    Open Console and scroll down the log list and look for Diagnostic Reports. See if there are any logs related to the apps or the times the programs didn't open. There are a few sections with Diagnostic Reports. If they full up crash, there should be something under CrashReporter.

  • Virtual Memory Leak

    In the course of tracking down a memory leak I've managed to start recollecting memory, but for some reason the process still refuses to free virtual memory. I'm just looking at the task manager and after a long period of memory use and then a garbage collection I get numbers like:
    MemUsage: 31,000k
    PeakMemUsage 393,000k
    VMSize 700,000k!!
    And the VMSize just keeps going up. Does anybody have any ideas about what would cause this? OptimizeIt just reports that the Java Heap is hunky-dory and make it look like everything is fine.

    Thanks for responding, but I'm not quite sure I
    understand what you're driving at. Isn't it a problem
    if my
    Unused, physical. Nothing is using it.
    and
    Unused, swap. Nothing is using it.
    can't be re-used by the OS?Not really.
    If your swap space fills up then it is a problem.
    If the physical memory fills up then the OS swaps it to the hard drive.
    >
    Is your point that my application shouldn't have a
    problem with this situation? I suppose that's true. My
    application is fine and can get all the memory it
    needs. However if the JVM is allocated 95% of the
    virtual memory on the machine then there's still a
    huge problem. I mean the OS starts running off the
    disk, it has to increase the swap space, etc.. And
    eventually there's just no more space to give. Not a
    good situation.
    Am I misunderstanding you?Somewhat. If you app fills up all of physical memory and all of the swap space then it is a problem (not to mention that your app will also probably be running at 1/10 of the speed it would normally.) But you can increase the swap space. If your app requires 1 gig, and your total virtual space is 5 gig, then it doesn't matter whether your app is using it. And it does have to be marked as in use. An app can request an allocation and it is not actually in use. And space that isn't in use does not use any real space.

  • New memory leak with CS4 update?

    I just downloaded the CS4 update last night, and was doing my normal photoshop work when I had to re-start the application due to what looks like a memory leak.
    Windows XP, 3GHZ dual core ( 45 nm one ), 4 GB RAM, NVidia 9600 GT, no GPU enabled ( still comes up with that error even with newest drivers ).
    128MB TIFF file was my source.
    I had 3 layers, then copy merged all to another layer so I could liquify.
    Liquify was getting REALLY sluggish when trying to zoom, but was usable.
    After 10 minutes here, I clicked "ok" to return the results, then it said there wasn't enough memory to do it. So I had to cancel. Process was using right around 2 GB. I saved my PSD file ( around 256 MB ) and closed it. CS4 was still using around 2 GB with no documents open. So I closed CS4 and I had multiple errors pop up saying couldn't export or copy from clipboard because not enough memory.
    Brought CS4 back up and loaded in that 256MB psd file, everything was fine.

    I've been told by support that I need to un-install CS4, and re-install it and the patch in order to rectify my problem. The cause of the problem they are saying is a failed application of the patch.
    Is this a bunch of BS to keep me busy for a while? How do I know that the next time everything will install correctly?
    This will take some time to do, and I'll have to figure out how to backup all my settings/scripts.

  • There appears to be a MAJOR issue (hang/memory leak) in "about:home", also known as the Firefox Start Page, in Firefox 26.0 on Windows!

    There appears to be a MAJOR issue (hang/memory leak) in "about:home", also known as the Firefox Start Page, in Firefox 26.0, on Windows!
    observed on:
    - Windows 7 x64 machine with 12GB RAM and high-performance CPU (core i7-920)
    - Virtual Machine guest running WinXP SP3 (in Oracle VirtualBox) on the same machine
    - Intel Atom D525 netbook with 4GB RAM, running Win7 x64
    Neither of these machines are connected via Sync or anything like that. The Firefox instance on the VM is a fresh/clean install.
    The problem:
    - 100% cpu usage for 10 seconds, memory usage (PF usage in XP) goes up to 1.7GB
    - if "about:home" is the Firefox Start Page, effectively it hangs the computer at Firefox startup for 10 seconds
    - if "about:home" is NOT the Firefox Start Page, startup is fine - BUT if I press the "home" button on the toolbar it loads "about:home" which causes the same issue again

    Thank you cor-el! Your suggestion has solved the problem on my WinXP VM which I was using to test, and I will soon confirm that it has also solved the problem on my primary Win7 desktop.
    To recap:
    - I set "browser.aboutHomeSnippets.updateUrl" to an empty string
    OLD VALUE: https://snippets.mozilla.com/%STARTPAGE_VERSION%/%NAME%/%VERSION%/%APPBUILDID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/
    NEW VALUE: (blank)
    - I deleted the folder \storage\persistent\moz-safe-about+home under the Profile directory
    Actual folder name on WINDOWS XP:
    C:\Documents and Settings\<USERNAME>\Application Data\Mozilla\Firefox\Profiles\<PROFILENAME>\storage\persistent\moz-safe-about+home
    However I have a concern that the '''OLD VALUE''' of "browser.aboutHomeSnippets.updateUrl" will creep back in, in a future update! Can you communicate this issue to someone on the development team?

Maybe you are looking for

  • Currency conversion error in Update rules for 0SD_C03

    Hi All I have freshly installed Sales Overview cube 0SD_C03 from BI Content(3.x version) and when extracting data from datasource "2LIS_13_VDITM" there is an error "Error: Conversion foreign curr. -> local curr.: 0090000000 20080516 M -> SGD". Till P

  • Why aren't my photos shown in my cloud?  My photo stream is ON.

    When I log into my Icloud account, my photos are not shown.  My contacts, mail, notes, etc are there.  My photo stream on my Iphone (my only Apple device) is turned ON.  Can you tell my why my photos are not shown in my cloud when I have them set to

  • OS 10.2.1 upgrade and bluebooth issues

    Since the recent upgrade the bluetooth connection to my car audio keeps falling out. Also when it reconnects the audio works but the data on the song, artist etc is not displayed on the car media screen. Has anyone else encountered this problem?

  • Reader XI do NOT want opening FULL SCREEN!

    I am running Adobe Reader XI Version 11.0.2 on a Dell Windows 7 workstation with dual monitors.  We generally have a dozen applications open and we bounce all around between them.  Whenever I open a PDF document which ever monitor it was opened on la

  • Effects on players

    Hi, I'm fairly new to photoshop and I was just wondering if anyone knew how to get a player to look like they do in these pictures - the glossy, dark look. Thanks https://twitter.com/type1graphics/status/375774097592291328/photo/1 https://twitter.com