flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Taylor <ja...@dedoose.com>
Subject RE: massive memory leak in Flex
Date Thu, 02 Mar 2017 22:42:17 GMT
Also here's a screen shot of Scout - http://imgur.com/a/WCkZu 


-----Original Message-----
From: Jason Taylor [mailto:jason@dedoose.com] 
Sent: Thursday, March 02, 2017 2:37 PM
To: dev@flex.apache.org
Subject: massive memory leak in Flex

I believe I have finally identified the cause of a huge memory leak in our application, and
it appears to be s:label I have tested this on many different framework versions.

Please try the following:    if you make a custom itemrender and don't use the s:label it
goes away, note disabiling TextLineReycler has no effect.  

Using task manager, scout, and IntelliJ Idea Flex profiler all confirm the memory leak.  This
seems like a massive issue and has been causing a lot of slowdown and crashes in our app.
I'm guessing I must have messed something up somewhere as I don't see how sucha  massive issue
could have been in the framework for soo long (Tested 4.13, 4.14, and 4.15).  Please Advise.
~ JT


<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
creationComplete="OnCreationComplete(event)">
    <s:List width="100%" height="100%" id="list"/>
    <fx:Script><![CDATA[
        import mx.collections.ArrayCollection;
        import mx.events.FlexEvent;

        private var _bindTimer:Timer;

        private function OnCreationComplete(event:FlexEvent):void
        {
            _bindTimer = new Timer(500);
            _bindTimer.addEventListener(TimerEvent.TIMER, OnBindTimerTick, false, 0, true);
            _bindTimer.start();
        }

        private function OnBindTimerTick(event:TimerEvent):void
        {
            BindData();
        }

        private function BindData():void
        {
            var items:Array = [];
            for (var i:uint = 0; i < 100; i++)
            {
                items.push(GenerateRandomString(100));
            }
            list.dataProvider = new ArrayCollection(items);
            callLater(BindData);
        }

        private function GenerateRandomString(strlen:Number):String
        {
            var chars:String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
            var num_chars:Number = chars.length - 1;
            var randomChar:String = "";

            for (var i:Number = 0; i < strlen; i++)
            {
                randomChar += chars.charAt(Math.floor(Math.random() * num_chars));
            }
            return randomChar;
        }
        ]]></fx:Script>
</s:Application>

Mime
View raw message