[flexcoders] Re: Memory leaks in a asyncronic operation

2009-05-08 Thread Rob Kunkle
I'm running into a similar problem, but I don't think the issue is the async 
jpeg encoding. I think the problem is generally with flash player.

I'm working on a flash application that gets large (~15mb) jpeg images from the 
users file system, the resizes them and recompresses them using the async jpeg 
encoder class, then uploads the results to a server.

It works fine if you are only doing this with a few images, but when you run 
the software with hundreds of images, flash eventually crashes.

I switched back to the native jpeg encoder, and still had the same problem. 
When I run the profiler, flash seems to be doing everything right...the 
application runs using a steady amount of memory, and there are not excessive 
objects being created then loitering.

However, when i look at the mac's activitiy monitor (this is similar to task 
man on windows)...Firefox steadily uses up more and more real memory and 
virtual memory as the images are uploaded. Eventually flash crashes when it has 
used up all the system memory available.

So it appears that the flash player is not returning unused memory back to the 
browser, or that the browser can't make use of the freed up memory.

I've tried reusing ojects, BitmapData.dispose(), unloading, unloadandStop(), 
etc... I can't seem to find a way to fix this one.

Has anyone run into a similar problem loading lots of content into flash 
player, but not able to recover the memory?

Help with this one would be much appreciated!

Rob





 




 


--- In flexcoders@yahoogroups.com, "cavi21"  wrote:
>
> Hello, i've been searching for a while to a solution to this problem,
> and i've been trying myself, with no succeed.
> The problem is this, i'm encoding to JPEG six bitmap captures from a
> webcam stream in a video component.
> Up to here, is no problem. But if I used the native class to encode
> (mx.graphics.codec.JPEGEncoder) the AIR application hang for 2 minutes
> processing the images. In these case at the end of the process i call
> a function to free up the memory, and everything works fine.
> The problem is that i'm using a modified class to encode
> (http://blog.paranoidferret.com/index.php/2007/12/11/flex-tutorial-an-asynchronous-jpeg-encoder/)
> . The benefit is that i can show a progressbar showing the encoding
> process. But the only problem that i have is that, at the end of the
> process, i have memory hang up... i've been reading that these may
> occur  without a proper care in the events listeners.
> Sory about my english, is not ma native language, and thanks in
> advance for your time and patience.
>




[flexcoders] Re: Memory leaks in a asyncronic operation

2008-06-04 Thread cavi21
I couldn't resolve my problem with the memory leak, but instead I
resolve the problem of encoding to JPEG far much faster than with the
JPGEncoding Class.

Thanks anyway, cheers.



RE: [flexcoders] Re: Memory leaks in a asyncronic operation

2008-06-03 Thread Alex Harui
I don't know what books and other materials are out there.  Note that
there are filters that don't show certain classes.  Maybe they are
hiding the true leak

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of cavi21
Sent: Tuesday, June 03, 2008 5:05 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Memory leaks in a asyncronic operation

 

Hello Alex, thanks for your reply, I've been using it, and the only
thing that i found is an 
instance of "BitString" defined in the custom class i'm using to encode
, that is not leave 
memory after the method that create it ended. On the other hand, if i
use the native class, 
this instance never appears in the Profiler.

Is there any good book or guide that helps to take full profit of the
Profiler??

thanks

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> The Flex3 Profiler can help you find memory leaks
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of cavi21
> Sent: Monday, June 02, 2008 2:10 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Memory leaks in a asyncronic operation
> 
> 
> 
> Hello, i've been searching for a while to a solution to this problem,
> and i've been trying myself, with no succeed.
> The problem is this, i'm encoding to JPEG six bitmap captures from a
> webcam stream in a video component.
> Up to here, is no problem. But if I used the native class to encode
> (mx.graphics.codec.JPEGEncoder) the AIR application hang for 2 minutes
> processing the images. In these case at the end of the process i call
> a function to free up the memory, and everything works fine.
> The problem is that i'm using a modified class to encode
>
(http://blog.paranoidferret.com/index.php/2007/12/11/flex-tutorial-an-as
<http://blog.paranoidferret.com/index.php/2007/12/11/flex-tutorial-an-as
> 
> ynchronous-jpeg-encoder/
>
<http://blog.paranoidferret.com/index.php/2007/12/11/flex-tutorial-an-as
<http://blog.paranoidferret.com/index.php/2007/12/11/flex-tutorial-an-as
> 
> ynchronous-jpeg-encoder/> )
> . The benefit is that i can show a progressbar showing the encoding
> process. But the only problem that i have is that, at the end of the
> process, i have memory hang up... i've been reading that these may
> occur without a proper care in the events listeners.
> Sory about my english, is not ma native language, and thanks in
> advance for your time and patience.
>

 



[flexcoders] Re: Memory leaks in a asyncronic operation

2008-06-03 Thread cavi21
Hello Alex, thanks for your reply, I've been using it to find the problem and 
the only thing 
that i find is that an instace of a "BitString" declare in my custom encode 
Class is not 
leaving the memory. Once I ended the methot that created and instance keeps in 
memory.

Is there a manual of how to get the full use of the Profiler in Flex 3?



--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> The Flex3 Profiler can help you find memory leaks
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of cavi21
> Sent: Monday, June 02, 2008 2:10 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Memory leaks in a asyncronic operation
> 
>  
> 
> Hello, i've been searching for a while to a solution to this problem,
> and i've been trying myself, with no succeed.
> The problem is this, i'm encoding to JPEG six bitmap captures from a
> webcam stream in a video component.
> Up to here, is no problem. But if I used the native class to encode
> (mx.graphics.codec.JPEGEncoder) the AIR application hang for 2 minutes
> processing the images. In these case at the end of the process i call
> a function to free up the memory, and everything works fine.
> The problem is that i'm using a modified class to encode
> (http://blog.paranoidferret.com/index.php/2007/12/11/flex-tutorial-an-as
> ynchronous-jpeg-encoder/
>  ynchronous-jpeg-encoder/> )
> . The benefit is that i can show a progressbar showing the encoding
> process. But the only problem that i have is that, at the end of the
> process, i have memory hang up... i've been reading that these may
> occur without a proper care in the events listeners.
> Sory about my english, is not ma native language, and thanks in
> advance for your time and patience.
>





[flexcoders] Re: Memory leaks in a asyncronic operation

2008-06-03 Thread cavi21
Hello Alex, thanks for your reply, I've been using it, and the only thing that 
i found is an 
instance of "BitString" defined in the custom class i'm using to encode , that 
is not leave 
memory after the method that create it ended. On the other hand, if i use the 
native class, 
this instance never appears in the Profiler.

Is there any good book or guide that helps to take full profit of the Profiler??

thanks


--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> The Flex3 Profiler can help you find memory leaks
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of cavi21
> Sent: Monday, June 02, 2008 2:10 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Memory leaks in a asyncronic operation
> 
>  
> 
> Hello, i've been searching for a while to a solution to this problem,
> and i've been trying myself, with no succeed.
> The problem is this, i'm encoding to JPEG six bitmap captures from a
> webcam stream in a video component.
> Up to here, is no problem. But if I used the native class to encode
> (mx.graphics.codec.JPEGEncoder) the AIR application hang for 2 minutes
> processing the images. In these case at the end of the process i call
> a function to free up the memory, and everything works fine.
> The problem is that i'm using a modified class to encode
> (http://blog.paranoidferret.com/index.php/2007/12/11/flex-tutorial-an-as
> ynchronous-jpeg-encoder/
>  ynchronous-jpeg-encoder/> )
> . The benefit is that i can show a progressbar showing the encoding
> process. But the only problem that i have is that, at the end of the
> process, i have memory hang up... i've been reading that these may
> occur without a proper care in the events listeners.
> Sory about my english, is not ma native language, and thanks in
> advance for your time and patience.
>