HTTPService + XML Load + Memory Leak

Hi all....
I have noticed a memory leak in my application. This leak was
not apparent when the application was completed some months back
which is what left me a little confused as all I have done since
was upgrade to Flex 3 and possibly updated / changed my Flash
player.
I think I have found the cause to this problem (below) but am
not 100% sure that it is the "actual" problem or any reasons to
back my thoughts up, so have listed what I have checked / tried
along the way (maybe I have missed something)....
My Discovery Process:
I started profiling my application but did not find anything
out of the ordinary. I did a code walk-through double checking I
had cleaned up after myself, removing and even nulling all items
etc but still to now success - the leak is still there.
I have profiled the app in the profiler for reasonably long
periods of time.
All the classes etc being used within the app are consistent
in size and instance amount and there is no sign of any apparent
leak.
I am using a HTTPService that is loading XML data which I am
refreshing every 5 seconds. On this 5 second data refresh some
class instances are incremented but are restored to the expected
amount after a GC has occurred. The GC seems to take longer, the
longer the app is running, therefore more and more instances are
being added to the app, but when the GC eventually runs it "seems"
to clear these instances to the expected amount.
After scratching my head for a while I decided to make a copy
of my application, rip everything out, and focus in my data load,
where I found a problem!
I have now just a HTTPService that loads an XML file every 5
seconds, and this is all I currently have in the app (as I ripped
the rest of the code out), e.g:
Code:
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
....... creationComplete="initApp()" >
<mx:HTTPService
id="httpServiceResults"
url="
http://myIP:myPort/myRoot/myXML.cfm"
resultFormat="e4x"
result="httpResultHandler(event)" />
<script....... >
private var timerPulse:Timer;
private function initApp():void
httpServiceResults.send();
timerPulse = new Timer(5000, 0);
private function httpResultHandler(event:ResultEvent):void
timerPulse.start();
timerPulse.addEventListener(TimerEvent.TIMER, timerRefresh);
public function timerRefresh(eventObj:TimerEvent):void
timerPulse.stop();
timerPulse.removeEventListener(TimerEvent.TIMER,
timerRefresh);
timerPulse.reset();
httpServiceResults.send();
</script>
</mx:Application>
This is pretty much the code I am currently using and it
leaks.
I ran and monitored this in both the profiler and the
activity / task manager, and after running the app for 1800 seconds
(30 min) in the profiler, the memory size grew from 50mg to 165mg
just sending the HTTPService.
I tried loading the service in multiple ways including in AS
rather than MXML creating new instances of it each time, resetting
it, nulling it etc... but nothing prevented this memory increase.
I then tried to load the XML using different methods such as
using the URLRequest and URLLoader which again caused a memory
leak.
What still confuses me is that this leak did not exist in the
previous version and not a great deal has changed since then apart
from upgrading to Flex 3 and possibly upgrading my Flash payer
(which I believe is a possible cause)
After looking into this issue a bit more deeply, I read a few
blogs / forums and other people are experiencing the same problems
- even with a lot bigger leaks in some cases all when reloading
large sets of XML data into Flex - however, I as of yet found no
solution to this leak - people with a similar problem believe it is
not due to a memory leak more a GC error, and others pointing
towards the Flash Player itself that is leaking - I don't really
know.
Findings so far during investigation of this issue:
* App leaks for both HTTPService and ULRRequest / URLLoader
methods
* App only leaks when calling a data loader
* The size of the leak seems to depend on the size of the
XML being loaded
* The size of the leak also seems to be affected by the
applications heaviness - the greater seems to enhance the leak
An interesting factor I have noticed is that if I copy the
XML from my "myXML.cfm" that I link to in my HTTPService and copy
the contents of the file into my own XML file stored within the
Flex project root itself: ""myXML.xml"" the leak disappears... like
it seems to link when loading the XML over a network, however as my
network knowledge is not great I am not sure what to make of this -
any ideas???
Could the connection to the XML document cause leaks??? is
there anything else that could cause this leak??? have I something
in my code sample that could cause this leak??? or could any of the
other things I have mentioed cause this leak???
Any help / ideas would be greatly appreciated.
Thanks,
Jon.

I also observed heavy memory leak from using httpservice with
XML data. I am using Flex3 builder under Linux. My Flex application
polls httpservice every 10 seconds. The reply is a short XML
message less than 100 bytes. This simple polling will consume 30+
MB of memory every hour. I leave it idling for several hours and it
took 200 MB of memory. No sign of garbage collection at all.

Similar Messages

  • Loader memory leak... hellp me

    Hello everyone...
    I have a memory leak problem.. from Loader..
    when i image load that memory is up..next when i image
    unloadd.. but memory is not down and not delete..
    I don't know..
    *.fla my code
    c.buttonMode = true;
    d.buttonMode = true;
    c.addEventListener(MouseEvent.CLICK, cHandler);
    d.addEventListener(MouseEvent.CLICK, dHandler);
    var loader:Loader;
    var bitmap:BitmapData;
    function cHandler(e:MouseEvent):void
    loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    onComplete, false, 0, true);
    loader.contentLoaderInfo.addEventListener(Event.UNLOAD,
    closeHandler, false, 0, true);
    loader.contentLoaderInfo.addEventListener(Event.OPEN,
    openHandler, false, 0, true);
    loader.load(new URLRequest("
    http://www.graphicsarcade.com/holidays/christmas/comments/christmas_comments_02.gif"))
    this.addChild(loader);
    trace("init2 = "+System.totalMemory/10000);
    t.appendText("init2 = "+System.totalMemory/10000+"\n");
    function openHandler(e:Event):void
    trace("openHandler");
    trace("open load - "+System.totalMemory/10000);
    t.appendText("open load = "+System.totalMemory/10000+"\n");
    function closeHandler(e:Event):void
    trace("close Handler");
    function onComplete(e:Event):void
    trace("e.currentTarget.parent =
    "+DisplayObject(e.currentTarget.content.parent));
    var loaders = DisplayObject(e.currentTarget.content.parent)
    as Loader;
    trace("loader = "+loaders);
    trace("load finished = "+System.totalMemory/10000);
    loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,
    onComplete);
    loader.contentLoaderInfo.removeEventListener(Event.OPEN,
    openHandler);
    trace("load finished = "+System.totalMemory/10000);
    function dHandler(e:MouseEvent):void
    trace("before delete - "+System.totalMemory/10000);
    t.appendText("before delete =
    "+System.totalMemory/10000+"\n");
    if (bitmap!=null) bitmap.dispose()
    trace("bitmap.dispose - "+System.totalMemory/10000);
    t.appendText("bitmap.dispose =
    "+System.totalMemory/10000+"\n");
    loader.contentLoaderInfo.removeEventListener(Event.INIT,
    onComplete)
    t.appendText("removeEventListener =
    "+System.totalMemory/10000+"\n");
    if (loader!=null)
    this.removeChild(loader);
    loader.unload();
    loader = null;
    t.appendText("loader = null =
    "+System.totalMemory/10000+"\n");
    var timer = new Timer(1000, 120);
    timer.addEventListener(TimerEvent.TIMER, timerHandler);
    timer.addEventListener(TimerEvent.TIMER_COMPLETE,
    timeComplete);
    timer.start();
    trace("init = "+System.totalMemory/10000);
    t.appendText("init = "+System.totalMemory/10000+"\n");
    function timerHandler(e:TimerEvent):void
    trace("timer - "+System.totalMemory/10000)
    t.appendText("timerl = "+System.totalMemory/10000+"\n");
    function timeComplete(e:TimerEvent):void
    trace("time complete - "+System.totalMemory/10000)
    t.appendText("time complete =
    "+System.totalMemory/10000+"\n");
    output
    init = 625.4592
    init2 = 676.2496
    openHandler
    open load - 683.2128
    e.currentTarget.parent = [object Loader]
    loader = [object Loader]
    load finished = 737.6896
    load finished = 737.6896
    before delete - 737.6896
    bitmap.dispose - 737.6896
    close Handler
    timer - 737.6896
    timer - 737.6896
    timer - 737.6896
    timer - 737.6896
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.5088
    why can not delete memory..?
    please any one hellp me...

    Hello everyone...
    I have a memory leak problem.. from Loader..
    when i image load that memory is up..next when i image
    unloadd.. but memory is not down and not delete..
    I don't know..
    *.fla my code
    c.buttonMode = true;
    d.buttonMode = true;
    c.addEventListener(MouseEvent.CLICK, cHandler);
    d.addEventListener(MouseEvent.CLICK, dHandler);
    var loader:Loader;
    var bitmap:BitmapData;
    function cHandler(e:MouseEvent):void
    loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    onComplete, false, 0, true);
    loader.contentLoaderInfo.addEventListener(Event.UNLOAD,
    closeHandler, false, 0, true);
    loader.contentLoaderInfo.addEventListener(Event.OPEN,
    openHandler, false, 0, true);
    loader.load(new URLRequest("
    http://www.graphicsarcade.com/holidays/christmas/comments/christmas_comments_02.gif"))
    this.addChild(loader);
    trace("init2 = "+System.totalMemory/10000);
    t.appendText("init2 = "+System.totalMemory/10000+"\n");
    function openHandler(e:Event):void
    trace("openHandler");
    trace("open load - "+System.totalMemory/10000);
    t.appendText("open load = "+System.totalMemory/10000+"\n");
    function closeHandler(e:Event):void
    trace("close Handler");
    function onComplete(e:Event):void
    trace("e.currentTarget.parent =
    "+DisplayObject(e.currentTarget.content.parent));
    var loaders = DisplayObject(e.currentTarget.content.parent)
    as Loader;
    trace("loader = "+loaders);
    trace("load finished = "+System.totalMemory/10000);
    loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,
    onComplete);
    loader.contentLoaderInfo.removeEventListener(Event.OPEN,
    openHandler);
    trace("load finished = "+System.totalMemory/10000);
    function dHandler(e:MouseEvent):void
    trace("before delete - "+System.totalMemory/10000);
    t.appendText("before delete =
    "+System.totalMemory/10000+"\n");
    if (bitmap!=null) bitmap.dispose()
    trace("bitmap.dispose - "+System.totalMemory/10000);
    t.appendText("bitmap.dispose =
    "+System.totalMemory/10000+"\n");
    loader.contentLoaderInfo.removeEventListener(Event.INIT,
    onComplete)
    t.appendText("removeEventListener =
    "+System.totalMemory/10000+"\n");
    if (loader!=null)
    this.removeChild(loader);
    loader.unload();
    loader = null;
    t.appendText("loader = null =
    "+System.totalMemory/10000+"\n");
    var timer = new Timer(1000, 120);
    timer.addEventListener(TimerEvent.TIMER, timerHandler);
    timer.addEventListener(TimerEvent.TIMER_COMPLETE,
    timeComplete);
    timer.start();
    trace("init = "+System.totalMemory/10000);
    t.appendText("init = "+System.totalMemory/10000+"\n");
    function timerHandler(e:TimerEvent):void
    trace("timer - "+System.totalMemory/10000)
    t.appendText("timerl = "+System.totalMemory/10000+"\n");
    function timeComplete(e:TimerEvent):void
    trace("time complete - "+System.totalMemory/10000)
    t.appendText("time complete =
    "+System.totalMemory/10000+"\n");
    output
    init = 625.4592
    init2 = 676.2496
    openHandler
    open load - 683.2128
    e.currentTarget.parent = [object Loader]
    loader = [object Loader]
    load finished = 737.6896
    load finished = 737.6896
    before delete - 737.6896
    bitmap.dispose - 737.6896
    close Handler
    timer - 737.6896
    timer - 737.6896
    timer - 737.6896
    timer - 737.6896
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.0992
    timer - 738.5088
    why can not delete memory..?
    please any one hellp me...

  • Possible memory leak in e4x or HTTPService with e4x format

    Hello,
    I think I have found a memory leak in e4x.
    In very special cases (=xml) the player swallows the memory.
    The little test program connects to a web server for an xml
    file, and the result is converted to an array.
    The array is displayed in a DataGrid.
    There are two files:
    leaktest.xml doesn't leak in any cases (format: e4x or xml)
    pbentries.xml leaks when the format is e4x.
    Choose e4x format and check Use "Leak" file! Than the program
    leaks.
    For the whole test case (mxml file, html file and xml files)
    please contact me at
    [email protected]
    or
    [email protected]
    and I send a zip file as soon as possible.
    Probably there is a bug in my test program. If so than please
    send me a feedback.
    Thanks,
    Lacito
    ------ For the program cut here ------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.managers.PopUpManager;
    import mx.core.Application;
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.http.mxml.HTTPService;
    protected var records_:Array = null;
    protected var httpService:HTTPService = null;
    [Bindable("recordsChange")]
    public function set records(_records:Array):void
    this.records_ = _records;
    var e:Event = new Event("recordsChange");
    dispatchEvent(e);
    public function get records():Array
    return records_;
    protected function getXML():void
    var resultFormat:String = cbResultFormat.selectedItem as
    String;
    var params:Object = new Object();
    httpService = new HTTPService();
    httpService.concurrency = "single";
    httpService.showBusyCursor = true;
    var lastIndex:int = url.lastIndexOf("/");
    var fileName:String = null;
    if(chbUseLeakFile.selected)
    // It leaks... :(
    fileName = "pbentries.xml";
    else
    // It doesn't leak... :)
    fileName = "leaktest.xml";
    var _url:String = url.substr(0, lastIndex+1) + fileName;
    httpService.url = _url;
    httpService.resultFormat = resultFormat;
    httpService.method = "POST";
    httpService.addEventListener(ResultEvent.RESULT,
    processResult);
    httpService.addEventListener(FaultEvent.FAULT,
    processFault);
    httpService.send(params);
    protected function processResult(e:ResultEvent):void
    var resultFormat:String = cbResultFormat.selectedItem as
    String;
    removeListeners();
    if(resultFormat==mx.rpc.http.HTTPService.RESULT_FORMAT_XML)
    setArrayFromXMLNode();
    else
    setArrayFromXML();
    destroyHttpService();
    // format= "e4x"
    protected function setArrayFromXML():void
    var xml_:XML = httpService.lastResult as XML;
    var ar:Array = new Array();
    var x:XML = null;
    var xl:XMLList = xml_.phonebookEntries[0].phonebookEntry;
    for each(x in xl)
    var record:Object = new Object();
    var prop:XML = null;
    var props:XMLList = x.children();
    for each(prop in props)
    record[prop.localName()] = prop.toString();
    ar.push(record);
    records = ar;
    // format= "xml"
    protected function setArrayFromXMLNode():void
    var xml_:XMLNode = httpService.lastResult as XMLNode;
    var ar:Array = new Array();
    var x:XMLNode = null;
    var xl:Array = xml_.lastChild.childNodes;
    for each(x in xl)
    var record:Object = new Object();
    var prop:XMLNode = null;
    var props:Array = x.childNodes;
    for each(prop in props)
    record[prop.localName] = prop.firstChild!=null ?
    prop.firstChild.nodeValue : null;
    ar.push(record);
    records = ar;
    protected function destroyHttpService():void
    httpService.clearResult(false);
    httpService.disconnect();
    httpService = null;
    protected function processFault(e:FaultEvent):void
    removeListeners();
    Alert.show(e.fault.faultString, e.fault.faultCode);
    destroyHttpService();
    protected function removeListeners():void
    httpService.removeEventListener(ResultEvent.RESULT,
    processResult);
    httpService.removeEventListener(FaultEvent.FAULT,
    processFault);
    protected function collect():void
    // Garbage Collection
    try
    new LocalConnection().connect('foo');
    new LocalConnection().connect('foo');
    catch(e:*)
    ]]>
    </mx:Script>
    <mx:ArrayCollection id="alRecords" source="{records}"
    />
    <mx:Label x="10" y="10" text="Result format:"
    id="lResultFormat"/>
    <mx:ComboBox x="104" y="8" id="cbResultFormat">
    <mx:Array>
    <mx:String>e4x</mx:String>
    <mx:String>xml</mx:String>
    </mx:Array>
    </mx:ComboBox>
    <mx:DataGrid id="dgRecords" x="10" y="36" width="936"
    height="437"
    dataProvider="{alRecords}"
    verticalScrollPolicy="auto"
    horizontalScrollPolicy="auto">
    </mx:DataGrid>
    <mx:Button x="355" y="496" label="Get xml" id="btnGetXML"
    click="{getXML();}" />
    <mx:Button x="155" y="496" label="GC" id="btnGC"
    click="{collect();}" />
    <mx:CheckBox x="276" y="10" label="Use
    &quot;LEAK&quot; file:" labelPlacement="left"
    id="chbUseLeakFile" selected="true"/>
    </mx:Application>

    Hello,
    After 3 months (and a new version of flex and flash player)
    my test program is still leaking.
    If somebody could confirm the leak it would be appreciated.
    Thanks,
    Lacito
    P.S.: I heard that Adobe had donated ActionScript 3 VM to
    Mozilla.org. Should I disturb them with my problem?

  • CVI dll to read XML file causes memory leak

    Hello,
    I am facing a memory leak issue when I execute a dll created using CVI to read a XML file.
    Each iteration of the step is taking around 200k of memory.
    Short description of the code:
    Basically I am using a function created in CVI to read from an XML file by tag which 2 attributes: command and the response;
    int GetCmdAndRsp(char XML_File[MAX_STR_SIZE], char tag[MAX_STR_SIZE], char Command[MAX_STR_SIZE], char Response[MAX_STR_SIZE], char ErrorDescription[MAX_STR_SIZE]) 
    inputs:  
    - XML_File_path;
    - tagToFind;
    ouputs:
    - Command;
    - Response;
    - Error;
    Example:
    XMLFile:
    <WriteParameter Command="0x9 %i %i %i %i %i" Response = "0x8 V %i %i %i %i"/>
    Execution:
    error = GetCmdAndRsp("c:\\temp\\ACS_Messages.xml" ,"WriteParameter", cmd, rsp, errStr) 
    output:
    error = 0
    cmd = "0x9 %i %i %i %i %i"
    rsp = "0x8 V %i %i %i %i"
    errStr = "Unkown Error"
    Everything is working correctly but I have this memory leak issue. Why am I having such memory consumption?? Is it a TestStand or CVI issue??
    Each iteration I am loading the file, reading the file and discarding the file.
    Attached you can find the CVI project, a TestStand sequence to test (ReadXML_test2.seq) and an example of a XML file I am using.
    Please help me here.
    Thaks in advance.
    Regards,
    Pedro Moreira
    Attachments:
    ReadXML_Prj.zip ‏1826 KB

    Pedro,
    When a TestStand step executes, its result will be stored by TestStand which will be later used for generating reports or logging data into database.
    You are looking at the memory (private bytes) when the sequence file has not finished execution. So, the memory you are looking at, includes the memory used by TestStand to store result of the step. The memory used for storing results will be de-allocated after finishing the sequence file execution.
    Hence, we dont know if there is actual memory leak or not. You should look at the memory, before and after executing sequence file instead of looking in between execution.
    Also, here are some pointers that will be helpful for checking memory leak in an application:
    1. TestStand is based on COM and uses BSTR in many function. BSTR caches the memory and because of the behavior, sometime you might get false notion of having memory leak. Hence, you need to use SetOaNoCache function OR set the OANOCACHE=1 environment variable to disable caching.
    2. Execute the sequence file atleast once before doing the actual memory leak test. The dry run will make sure all static variables are initialized before doing memory leak test.
    3. Make sure that the state of system or application is same when considering the Private bytes. Ex: Lets say ReportViewControl is not visible before you start executing sequence file. Then you note down the private bytes and then execute the sequence file. After finishing execution, make sure you close the ReportViewControl and then note down the private bytes once again to check if memory is leaked or not.
    4. If there exists memory leak as you specified, it is possible that the leak is either in TestStand, or in your code. Make sure that your code doesn't leak by creating a small standalone application (probably a console application) which calls your code.
    Detecting memory leaks in CVI is better explained in
    http://www.ni.com/white-paper/10785/en/
    http://www.ni.com/white-paper/7959/en/
    - Shashidhar

  • Memory Leak in UIWebview on loading NSURLRequest

    I have created a custom browser for my app. Whenever i load a url request into web view a memory leak is seen. A snapshot of the same is shown below
    Please note that no backtrace has been shown which makes life more painful. In my application a simple webview is shown and a refresh button is given below webview. A snapshot of same is shown below
    The code on refresh button is as follows
    - (IBAction)refresh:(id)sender
    // Some suggested solution on internet to fix leak but in vain
        [wvWebView loadHTMLString:@"" baseURL:nil];
        [wvWebView stopLoading];
        wvWebView.delegate = nil;
    // Clearing cache Memory
        [[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"WebKitCacheModelPreferenceKey"];
        [[NSURLCache sharedURLCache] removeAllCachedResponses];
        [[NSURLCache sharedURLCache] setDiskCapacity:0];
        [[NSURLCache sharedURLCache] setMemoryCapacity:0];
    // Deleting all the cookies
        for(NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies])
                [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];
    // Loading webview with desired url
        [wvWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
    Please help me to solve this issue as early as possible

    I have seen other apps sucessfully running in AppStore. Is there something which I am missing ??????. Help me with the issue Guys.......... it's putting  me out of businness.

  • Memory leak? Firefox won't load pages/open.

    Ok, I believe there is a memory leak. I am surfing ok then a page wont load. I go to taskmgr and I show that one firefox has 104,990 K of memory. The rest have at most 3,000K. After the page won't load I close Firefox. It won't open. I have to turn on PC and unplug to get it to open again.

    This issue can be caused by an extension or plugin that isn't working properly.
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]

  • Crystal Reports 2008 - Report Load error - Memory Leak Error?

    Hello
    <br>
    We have a problem with Crystal Reports 2008 with .NET 2.0.
    <br>
    CrystalDecisions.CrystalReports.Engine, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
    <br>
    The problem is that during high amount of report producing, errors in eventlog pops up and the production of reports using <br>
    Crystal Reports stops.
    <br>
    Below are examples of the three most common event logs.
    <br>
    We have tried to implement a cleanup method both as a destructor (with a global ReportDocument rdoc variable) and using direct call to cleanUpDoc() method when finished with loading doc:
    <br>
    ~IOServerClass()
    <br>
    <br>
                cleanupDoc();
    <br>
    <br>
    <br>
            private void cleanupDoc()
    <br>
    <br>
                try
    <br>
    <br>
                    if (rdoc != null)
    <br>
    <br>
                        rdoc.Close();
    <br>
                        rdoc.Dispose();
    <br>
                        rdoc = null;
    <br>
    <br>
                    this.CleanGlobalEvents();
    <br>
                    System.GC.Collect();
    <br>
    <br>
    <br>
    <br>
    The doc is loading using the "normal" method (in-process).
    <br>
    <br>
    try
    <br>
    <br>
                        rdoc = new ReportDocument();
    <br>
                        rdoc.Load(fullpathandreport); 
    <br>
    <br>
                   catch (Exception ex)
    <br>
    <br>
                    cleanupDoc();
    <br>
    <br>
    ...process doc....
    <br>
    cleanupDoc();
    <br>
    <br>
    Furthermore we have tried during Scalable tests of the system - but cannot produce the below errors ourselves. Only the customer can.
    <br>
    Please help with solving this problem.
    Is the above advisable to do?
    Should the document be loaded in another way?
    Is it a memory leak?
    <br>
    Regards
    Kristian
    <br>
    <br>
    event logs:
    <br>
    <br>
    #1
    <br>
    <br>
    Event Type:     Error
    Event Category:     None
    Event ID:     1102
    Date:          12-02-2010
    Time:          10:22:05
    User:          N/A
    Description:
    IO_ServerClass.IO_ServerPrepareReportBeforeExecute() Report load Error:
    Loading reportfile=C:\Inetpub\wwwroot\xxx\Reports\321.rpt
    Source=CrystalDecisions.CrystalReports.Engine
    Message=Load report failed.
    Stacktrace=   at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename,
    OpenReportMethod openMethod, Int16 parentJob)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
       at xxx.IOServer2.IOServerClass.IO_ServerPrepareReportBeforeExecute(String
    WebRootRelPathNameRepName, String init, Hashtable ParmsVals, Int32 JobId, Int32 JobStep,
    Page webpage) in C:\Documents and Settings\xxx\My Documents\Visual Studio 2008\Projects\xxx.IOServer2\IOServerClassClassic.cs:line 290
    InnerSource:Analysis Server
    InnerMes:
    Error in File 321 {19463E3B-D404-45EB-88AE-5722A7FF9E90}.rpt:
    The request could not be submitted for background processing.
    InnerStack:
       at
    CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object&
    DocumentPath, Int32 Options)
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object&
    DocumentPath, Int32 Options)
       at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
    <br>
    <br>
    #2
    <br>
    <br>
    IO_ServerClass.IO_ServerPrepareReportBeforeExecute() Report load Error:
    Loading reportfile=C:\Inetpub\wwwroot\xxx\Reports\321.rpt
    Source=CrystalDecisions.CrystalReports.Engine
    Message=Creating an instance of the COM
    component with CLSID {D7F5D7C3-B06C-4CAC-BC47-A06E66D2EE9B} from the IClassFactory failed
    due to the following error: 8007000e.
    Stacktrace=   at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.CreateRptDoc()
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper..ctor()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Initialize()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
       at Kimik.IOServer2.IOServerClass.IO_ServerPrepareReportBeforeExecute(String
    WebRootRelPathNameRepName, String init, Hashtable ParmsVals, Int32 JobId, Int32 JobStep, Page webpage) in C:\Documents and Settings\xxx\My Documents\Visual Studio 2008\Projects\xxx.IOServer2\IOServerClassClassic.cs:line 289
    <br>
    #3
    <br>
    <br>
    IO_ServerClass.IO_ServerPrepareReportBeforeExecute() Report load Error:
    Loading reportfile=C:\Inetpub\wwwroot\xxx\reports\340.rpt
    Source=CrystalDecisions.CrystalReports.Engine
    Message=Load report failed.
    Stacktrace=   at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename,
    OpenReportMethod openMethod, Int16 parentJob)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
       at Kimik.IOServer2.IOServerClass.IO_ServerPrepareReportBeforeExecute(String
    WebRootRelPathNameRepName, String init, Hashtable ParmsVals, Int32 JobId, Int32 JobStep,
    Page webpage) in C:\Documents and Settings\xxx\My Documents\Visual Studio 2008
    \Projects\xxx.IOServer2\IOServerClassClassic.cs:line 290
    InnerSource:CrystalDecisions.ReportAppServer.ClientDoc
    InnerMes:
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    InnerStack:
    at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object&
    DocumentPath, Int32 Options)
       at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object&
    DocumentPath, Int32 Options)
       at
    CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
    Edited by: kristians on Feb 16, 2010 2:57 PM

    Hi;
    First, ensure you have the latest service pack / hot fix for your version of Crystal Reports, and that the client has the same updates as well. Fix Pack 2.4 is the current latest, and can be downloaded from our downloads section.
    One of the errors is the Background Processing error, so have a look at the following article:
    http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/50a6f5e8-8164-2b10-7ca4-b5089df76b33&overridelayout=true
    Regards,
    Jonathan
    Follow us on Twitter u2013 http://twitter.com/SAPCRNetSup

  • Memory leak problems with loading videos over and over.

    I'm having memory leak problems with loading videos into a VideoPlayer aswell as FLVPlayback.
    What the flash should do:
    - Should be running for 7 days without having to restart the projector.
    - Interface that shows people around a 360 3D model with 5 different parts and at the stops it makes during the rotation you can click to zoom in on a location which plays a movie for that aswell.
    - Shows a video out of 5 parts for a 360 rotation in 3D in mp4 video (added each time and cleaned up, see code below).
    - Still images are used when the video clips are done playing (MovieClip in stage).
    - Should run automatically when there is no user interaction for X minutes.
    What the problem is:
    - The flash (as a exe and swf i guess) starts to consume memory over time (say 10 hours) until the projector crashes. This usually at around 1.75 GB of memory.
    I cannot see why the Flash cannot garbage collect this and free up the memory. Mabye there is something I don't understand about the garbage collection in flash?
    Here is some code from the video loading and playing:
    var fVideo:VideoPlayer;
    VideoCreate();
    function VideoReady(pEvent:VideoEvent):void
    trace("VideoReady()");
         // start playing video
    fVideo.play();
    function VideoLoad(pUrl:String):void
         trace("VideoLoad(" + pUrl +
         VideoCreate();
         if (pUrl != "")
              if (fVideoFolder + pUrl == fVideo.source)
                   fVideo.seek(0);
    VideoReady(null);
              } else {
    trace(fVideo.state);
                   if (fVideo.state !=
    VideoState.DISCONNECTED) fVideo.stop();
    fVideo.close();                                
    fVideo.load(fVideoFolder + pUrl);
         } else {
    // error no url
    function VideoCreate():void
         trace("VideoCreate()");
         // remove old one
         if (getChildAt(0) == fVideo)
              removeChildAt(0);
         fVideo = new
    VideoPlayer(1024, 768);
         addChildAt(fVideo, 0);
         fVideo.autoRewind = false;
    fVideo.addEventListener(VideoEvent.COMPLETE, VideoDonePlaying);
    fVideo.addEventListener(VideoEvent.READY, VideoReady);

    Hmm. It's in connection with Dropbox. Så apparantly you can only use one of the two at the same time if you want the programs integrated in Finder.

  • Avoid Bug 7146375 ORA-4030 MEMORY LEAK IN (Xml generation) in oracle 10g

    Hi All,
    I have to generate an xml from database which contains around 4 lac records. I had written a query using XmlSerialize and XmlElement.
    It does run properly for records less than 2 lacs.
    But when the record count goes above 2 lacs..it is throwing the following error -
    { ORA-04030: out of process memory when trying to allocate 1032 bytes (qmxlu subheap,qmemNextBuf:alloc)
    ORA-06512: at "SYS.XMLTYPE", line 111!}
    For the above error - I have tried increasing pga from 480M to 800M, but still we are getting the same error.
    After researching i found out -
    Cause
    This is caused by the following bug:
    Bug 7146375 ORA-4030 AND MEMORY LEAK IN SESSION HEAP: "KOH DUR HEAP D"
    Solution
    Bug 7146375 is fixed in 11.2
    So i tried out the query in another a db which has 11g installed and my query runs perfectly fine for records of upto 4 lacs.
    But since we have oracle 10g on our clients machine, are there other ways to achieve this XML generation other than this?
    Thanks.

    913389 wrote:
    After researching i found out -
    Cause
    This is caused by the following bug:
    Bug 7146375 ORA-4030 AND MEMORY LEAK IN SESSION HEAP: "KOH DUR HEAP D"
    Solution
    Bug 7146375 is fixed in 11.2
    So i tried out the query in another a db which has 11g installed and my query runs perfectly fine for records of upto 4 lacs.
    But since we have oracle 10g on our clients machine, are there other ways to achieve this XML generation other than this?I doubt it. If Oracle have investigated and created a bug report that says the solution is to upgrade to 11.2, then that's the answer, otherwise they would indicate that a particular 10g patch set can also be used.

  • [iPhone] Memory leak when UIWebview is loaded with URL

    I have created a custom browser in my app using UIWebview . A memory leak is seen on everytime webview is loaded with provided  url. A snapshot of the leak is shown below.You may note that no back trace is shown and hence cause of leak is unknown.
    Snapshot of leak
    Please help me with this issue as early as possible.

    You might want to take this discussion to the developers forums. This is a general user to user forum for using the iPhone. This is way outside the scope of general use.

  • Adobe AIR memory leak loading SWFs

    I was plagued by a memory leak that would crash my application after a few hours. The application had worked fine in the past but now was having issues and I thought it might have to do with using newer SDK's.
    In the end I discovered that if I loaded external swf that had been compiled in debug mode, they would not clear completely on unload and cause a memory leak.
    Compiling in release mode fixed the issue. Spent 3 days trying to figure it out.

    Any chance you can check that out with the latest AIR?
    Either way, it sounds like a bug, please report it at http://bugbase.adobe.com/ and then report the bug number here. 
    If you're able to provide a reproducable case that would really increase the chance that we can do something about it.
    Thanks,
    roymeo

  • Applet load and memory leak

    what are some methods to load an applet faster that is on the local machine? also, are there any applications to test for memory leaks? and are there ways to invoke garbage collection with code? thanx in advance.

    Applet on the local machine will load faster because file is already there
    use System.gc() to do a garbage collection

  • How Do I identify a Memory Leak?

    I know this is not enought information but...
    My application used 3 hashtables in a Data object to store application data. I retrive this data from an XML file. I also download XML and merge it into andother XML file. Some of these hashtables contain object that contain more hashtables.
    I am trying to use JProbe Profiler to find the leak. I notice the memory increases when I load the data into objects and put them into hash tables. I also notice an increase when I am merging newly downloaded XML into the current XML data. I am useing Nodelists and NOdes to get the data.
    Does anyone have any tips or suggestion on how to find a memory leak?
    Thank you,
    Al

    7 MB of XML file, loaded into a DOM? You realize, of
    course, that DOMs are data structures that take up
    memory, too, right?Yes I do. I load it into DOM then go through the Document and put the XML data into a custom file format (seialized objects). The data is sent from the server in the form of XML.
    There's your problem. If you load X MB into memory
    and keep it around as long as your application is
    running, that's not necessarily a "leak". Yeah I realized this but it seems that if I load 7MB of my objects into hashtables my memory usage shouldn't increase by 30MB. I just assumed it would stay around 10MB.
    The real issue is trading memory for CPU. If keeping
    them in memory is crashing your app with OOM errors,
    by all means just keep those objects in memory for as
    long as you need them and then let the GC clean them
    up. Don't put them in a Map, just let them have a
    narrow method scope. Recreate them every time you
    need them. Yes I'm beginning to see the light.
    I'm sure you're thinking, "But recreating them will
    cost CPU and slow down my app!" Yes, that's why it's
    a tradeoff between memory and CPU.
    Do you really need the whole document in memory at
    once? If you're just cherry picking a few values out
    of it, maybe you can use a SAX parser instead of a
    DOM.
    No I don't need all that data at once.
    >
    Either you're screwed or you need to rethink this.
    You'd better hope that it's really not needed at
    every moment for every client.After rethinking, I'm going to keep the serialized data in the file until I need it. Rather than searching through a hashtable for the object I want I will search the file.
    What are your JVM settings for -Xms and -Xmx? Maybe
    increasing those will do the trick.I did increase them and it helped a little, but I can still get a OutOfMemoryError if I try.
    Are you sure these are the culprits? Have you
    profiled the app to see if there are other sources of
    leaks?Yes I have been profiling the application. It seems that there is a memory leek. I am just having trouble identifing it. I know the memory increases at 2 points. When I load the XML data into the DOM and when I load the DOM into my Custom object and then into the Hashtables.
    Last resort? Buy more physical memory. It's cheap.I think I am going to keep unused data out of memory and access it form a file. After I make this change I think my memory usage will drop alot. I will profile again after I have this change made to see if there is a memory leak.
    Thanks for you help,
    Al

  • Memory Leak In DataService

    Hi All,
          I had posted this query to couple of other groups ..I am still struglling with this issue..Hope someone  will  help me out here
          I have  very basic application which uses  DataSerives over RTMP channel  to populate dataGrid , I have not used any  user defined component.
    This application has got LOAD data and Remove data  Button just to simulate the actual application
    What happens , when I click on LOAD data , It  loads the data from server(JBOSS) then I Remove all the data and force the GC to run
    If I continuously keep loading and removing the  data ,  memory goes up every time and after some times It reaches to threshold and  finally crashes the Browser.
    In actual application as soon as user logs in a dedicated DS destination is created..
        private function createDestination(destName:String):void{
                 var remoteService:RemoteObject = new RemoteObject("DestinationManager");
                 remoteService.addEventListener(ResultEvent.RESULT, resultHandler,false,0,true);
                 var operation:AbstractOperation = remoteService.getOperation("createDestination");
                 operation.send(destName);
                 var cs:ChannelSet = new ChannelSet();
                 var rtmpChannel:RTMPChannel = ServerConfig.getChannel("my-rtmp") as  RTMPChannel;
                 cs.addChannel(rtmpChannel);
                 tradeService = new DataService() ;
                 tradeService.destination=destName;
                 tradeService.channelSet = cs;  
    Now when user hits on Load data button to load the trade data ...
       public function loadData():void
             var remoteService:RemoteObject  = new RemoteObject("filterRemoteVO");
             var operation:AbstractOperation = remoteService.getOperation("loadData");
             tradeService.fill(tradeCollection);
             operation.send(rowData.text ,GUIID);
             tradeList.dataProvider = tradeCollection;
    Remove Data  hit I clean all the resource and released collection :-
          public  function  removeAll():void{
             if(tradeList.dataProvider){
                  tradeCollection.source = new Array();
                  tradeList.dataProvider.source = new Array();
                  tradeList.dataProvider = null;
                tradeService.release();
               tradeService.releaseCollection(tradeCollection);
              tradeService.channelSet.disconnectAll();
              tradeService.disconnect();
               tradeService.logout();
               System.gc();
    Except these 3 function I don't have any code which could cause memory leak.
    I m using
    LCDS 2.5
    Flex 3.0
    JBoss4.2
    Please see the mxml file below   , If  possible please have a look at it , I might  not be using dataSerice API correctly.
    I have been trying to solve this leak for last two week , I really need help from you guys.
    My client has already evaluating other contemporary technology because of this memory issue.
    I have also created scalled down war file which can be deployed on any  java application server.
    Any help will greatly be appreciated
    Regards,
    Dam
    ######################## MXML##########################
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
          creationComplete="init();" height="100%" width="100%"
         >
         <mx:Script >
         <![CDATA[
             import mx.containers.GridRow;
               import mx.utils.Base64Decoder;
             import mx.utils.StringUtil;
                import mx.events.CollectionEvent;
             import mx.formatters.Formatter;
             import mx.events.ResizeEvent;
             import mx.controls.DataGrid;
             import mx.effects.Fade;
             import mx.events.DataGridEvent;
             import mx.utils.ObjectUtil;
             import mx.events.ScrollEvent;
           import mx.formatters.DateFormatter;
           import mx.events.ListEvent;
           import mx.data.mxml.DataService;
           import mx.messaging.config.ServerConfig;
           import mx.messaging.channels.RTMPChannel;
           import mx.messaging.ChannelSet;
           import mx.rpc.AbstractOperation;
           import mx.rpc.remoting.RemoteObject;
           import mx.collections.ArrayCollection;
           import mx.controls.Alert;
           import mx.rpc.events.ResultEvent;
           import mx.messaging.messages.*;
           import mx.messaging.events.*;
           import mx.controls.Alert;
            private var GUIID:String;
            private var lastRollOverIndex:Number;
            public var tradeService:DataService=null;
            public var tradeCollection:ArrayCollection = new ArrayCollection();
           public var flag:Boolean = false;
            private function init():void {
               var guiId:String ="TEST";
                createDestination(GUIID);
            public function getData():void{
                 // memory.text =""+ ((System.totalMemory / 1024)/1024);
            public function releaseDataServices():void {
               //  tradeService.fill(null);
                    tradeService.release();
                   // tradeService.releaseCollection(tradeCollection);
                   tradeService.channelSet.disconnectAll();
                    tradeService.disconnect();
                    tradeService.logout();
                    //tradeService.dataStore = null;
                    /*Function for creating destination*/
              private function createDestination(destName:String):void{
                 var remoteService:RemoteObject = new RemoteObject("DestinationManager");
                 remoteService.addEventListener(ResultEvent.RESULT, resultHandler,false,0,true);
                 var operation:AbstractOperation = remoteService.getOperation("createDestination");
                 operation.send(destName);
                 var cs:ChannelSet = new ChannelSet();
                 var rtmpChannel:RTMPChannel = ServerConfig.getChannel("my-rtmp") as RTMPChannel;
                 cs.addChannel(rtmpChannel);
                 tradeService = new DataService() ;
                 tradeService.destination=destName;
                 tradeService.channelSet = cs;  
             //This function calls dataservice fill method depending on wheather destination is created or not
            private function resultHandler(event:ResultEvent):void{
               //call data service as destination is created successfully
                var status:Boolean = event.result as Boolean
               // Alert.show("status="+status);
                if(status){
                 getData();
               else{
                   //TODO report error to MATS app  
          public  function  removeAll():void{
             if(tradeList.dataProvider){
                  tradeCollection.source = new Array();
                  tradeList.dataProvider.source = new Array();
                  tradeList.dataProvider = null;
                tradeService.release();
               // tradeService.releaseCollection(tradeCollection);
              tradeService.channelSet.disconnectAll();
              tradeService.disconnect();
               tradeService.logout();
               System.gc();
           public function loadData():void
             var remoteService:RemoteObject  = new RemoteObject("filterRemoteVO");
             var operation:AbstractOperation = remoteService.getOperation("loadData");
             tradeService.fill(tradeCollection);
             operation.send(rowData.text ,GUIID);
             tradeList.dataProvider = tradeCollection;
       ]]>
    </mx:Script>
          <mx:DataGrid   id="tradeList"
                 initialize="tradeList.dataProvider = tradeCollection" horizontalScrollPolicy="auto"
                   height="659" x="0" y="84">
                <mx:columns>
                     <mx:DataGridColumn  headerText="Security Description" dataField="securityDesc"
                      />
                     <mx:DataGridColumn  headerText="B/S" dataField="transactionType"
                     />
                     <mx:DataGridColumn  headerText="Amount" dataField="amount"
                     />
                     <mx:DataGridColumn  headerText="Price Text" dataField="priceText"
                     />
                     <mx:DataGridColumn  headerText="Counterparty" dataField="counterParty"
                     />
                     <mx:DataGridColumn  headerText="Trade Date" dataField="tradeDate"
                     />
                     <mx:DataGridColumn  headerText="Settle Date" dataField="settleDate"
                     />
                     <mx:DataGridColumn  headerText="Trade Status" dataField="tradeStatusId"
                     />
                     <mx:DataGridColumn  headerText="Trader" dataField="trader"
                     />
                     <mx:DataGridColumn  headerText="Salesperson" dataField="salesperson"
                     />
                     <mx:DataGridColumn  headerText="Ticket Number" dataField="tradeNumber"
                     />
                     <mx:DataGridColumn  headerText="Entry Date" dataField="tradeTime"
                     />
                     <mx:DataGridColumn  headerText="Cancel Date" dataField="cancelDate"
                     />
                     <mx:DataGridColumn  headerText="Cancel Time" dataField="cancelTime"
                     />
                 </mx:columns>
              </mx:DataGrid >
             <mx:Grid x="149" y="23" width="995">
                     <mx:GridRow width="100%" height="100%">
                                <mx:GridItem width="100%" height="100%">
                                     <mx:Label text="Enter No of obejcts"   width="111"/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:TextInput name="row" id="rowData"   width="97"/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:Button  label="Load Data" click='loadData()'/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:Button  label="removeAll" click='removeAll()'/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:Label text="Total Memory"/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:TextInput text="Total Memory" id="memory"   width="97"/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:Label text="Grid Row Count"/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:TextInput name="GridRowCountN" id="GridRowCount"   width="97"/>
                             </mx:GridItem>
                     </mx:GridRow>
             </mx:Grid>
    </mx:Application>

    Hi Natasha,
    Sorry for late reply.
          I tried your suggestion but It did not help to release memory. Actully,this app contains only one event handler which is for remote method call , I dont think this could cause any memory leak.
    Profiling session reveals that It is the issue of DataService class.I dont know How do I convince  Adobe to investigate this issue.
    Regards,
    Dharmendra

  • PDF memory leak

    opening the following URL and scrolling down to the graphic in section 4.3 causes Safari 4 to consume all RAM and then crash.
    http://delivery.acm.org/10.1145/1370000/1364038/p1498-park.pdf?key1=1364038&key2 =4311574421&coll=GUIDE&dl=GUIDE&CFID=38984505&CFTOKEN=59537289

    I dont think you have a memory leak. I think the problem is the xml file is 1000000 records long and takes up too much memory. Even if you find a way to increase memory size, you are loading down the server too much for other people's applications to run. I suggest instead reading up on xml and learning how to read in only a few records at a time, processing it, and getting the next set of records to process. There are two methods to parse an xml file using an xml parser, one is to parse it all and put it in memory, the other is to process one record at a time (an xml book explains it better).
    However, I question why you have reports that are 1000000 records long. end-users cannot effectively use such records (you cant scroll through 1000000 records). I suggest finding a way to greatly decrease the number of records in each file such as by providing just the records a particular user needs to do his job and not all records. For instance, put a textfield on his screen to let him only fetch records within a certain date range.
    Lastly, I suggest putting your code in a try/catch/finally block where the finally block actually closes the objects. Example:
    finally{
    if(conn!=null)
    conn.close();
    }

Maybe you are looking for