on 08-12-2013 10:36 AM
Hello.
I have made Abap WebDynPro project with Flex Integration.
The integration works fine. But there is one problem.
Any data transmition from WebDynPro to Flash cause Memory Leak.
Simple example.
On the Flash side:
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
borderStyle="solid"
textAlign="left"
initialize = "initApp()"
resize="ApResize()"
fontSize="10" xmlns:ns1="components_package.*" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#3971BC, #3971BC]">
<mx:Script>
<![CDATA[
[Bindable]
public var g_DATASOURCE: ArrayCollection;
import sap.FlashIsland;
import mx.rpc.soap.SOAPFault;
import mx.collections.ArrayCollection;
import mx.controls.Label;
import mx.containers.Canvas;
import flash.display.*;
import mx.managers.*;
import mx.core.IFlexDisplayObject;
import flash.display.Stage;
import disposable_package.*;
public function initApp():void
{
FlashIsland.register(this);
FlashIsland.addEventListener(FlashIsland.EVENT_END_UPDATE, initUpdate);
// Start Timer
RefreshTimer = new Timer(5000, 0);
RefreshTimer.addEventListener(TimerEvent.TIMER, timerEventHandler);
RefreshTimer.start();
}
// send event to WebDynPro
private function timerEventHandler(event:TimerEvent):void
{
var totmem:Number = 0;
var lv_string: String;
lv_string = "EvRefreshTimer";
FlashIsland.fireEvent(this, lv_string, null);
}
// receive answer from WebDynPro
public function initUpdate(event:Event):void
{
var totmem:Number = 0;
var lv_string: String;
if (g_DATASOURCE != null )
{
g_DATASOURCE.removeAll();
g_DATASOURCE = null;
}
Label2.text = "";
totmem = (System.totalMemory / 1024);
lv_string = String(totmem);
lv_string = lv_string + ' KB';
Label2.text = lv_string;
}
]]>
</mx:Script>
<mx:Label x="580" y="12" text="Label" id="Label2" visible="false" />
</mx:Application>
On the WebDynPro Side:
method ONACTIONEVREFRESHTIMER .
data: lv_node type ref to IF_WD_CONTEXT_NODE.
data: lt_datasource type wd_this->ELEMENTS_G_DATASOURCE.
data: lt_itemsource type wd_this->ELEMENTS_G_ITEMSOURCE.
data: lv_element type ref to IF_WD_CONTEXT_ELEMENT.
*----------------------------------------------------------
clear lt_datasource[].
lv_node = wd_context->get_child_node( wd_this->WDCTX_G_DATASOURCE ).
lv_node->CLEAR_SELECTION( ).
lv_node->bind_table(
new_items = lt_datasource
set_initial_elements = abap_true ).
endmethod.
In Label2 the number increase any time of Timer trigger.
With best regards Roman Gorobchenko.
See the attached link for details.
http://stackoverflow.com/questions/1020146/why-sytem-totalmemory-keeps-increasing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.