PDA

View Full Version : Possible memory leak in e4x or in HttpService


lacito
02-08-2007, 09:22 AM
Hello,

I think I have found a memory leak in e4x.
In very special cases (=xml) the player swallows the memory.

I have posted this "probably" bug in the Adobe forums a few month ago. No answers yet. Could somebody confirm the leak? Or is it my fault?

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! The program leaks.

The whole test case (swf file, mxml file, html file and xml files) is attached.
Extract it and copy to a web server folder. (For example: Apache: htdocs/leaktest2)
Then run it with a browser. (For example: http://localhost/leaktest2/LeakTest2.html)

Probably there is a bug in my test program. Or in the player. If so than please send me a feedback!

Thanks,

Lacito

lacito
02-09-2007, 08:18 AM
Hello,

I forgot to attach the source code.

Now you can find it in this reply.

A little user guide for the program:

1) Start the program. (Select http://localhost/LeakTest2.html)
2) Choose the format. (e4x leaks with pbentries.xml).
3) Hit the "Get xml" button.
4) The program downloads the pbentries.xml (if Use "LEAK" file is selected) or leaktest.xml (if Use "LEAK" file is not selected).
5) Hit the "Get xml" button again and again, but always wait for finishing the download.
6) You can hit the "GC" button. It enforces the garbage collection. The allocated memory is displayed at the top of the window (first in bytes, second in MB).
7) If you want to test an other file or format, please restart the program hitting refresh on the browser's toolbar.

My result:

Format: e4x, Use "LEAK" file is selected -> leaks
Format: e4x, Use "LEAK" file is not selected -> does not leak
Format: xml, Use "LEAK" file is selected -> does not leak
Format: xml, Use "LEAK" file is not selected -> does not leak

Thanks for the testing. Please, confirm my result.
If you find a bug in my program then send me reply, too.

Thank you again!

Lacito

lacito
02-15-2007, 08:42 AM
Hello,

There is a new pbentries.xml file. I have replaced double acute O with W.

And it leaks, too.

Firefox and Dreamweaver opens the pbentries.xml file, but very slowly.

JEdit crashes. Sorry! I need a large file to test.

Thanks,

Lacito

P.S.: I have posted this problem in FlexCoders, too.

dr_zeus
02-15-2007, 05:36 PM
If you haven't already, I highly suggest you tell Adobe if you think you've found a bug.

Bug Reports (http://www.adobe.com/go/wish)

You may not be able to attach your zipped files, but you can tell them that you have examples, and someone will likely ask for them via email.

lacito
02-16-2007, 07:58 AM
I have already reported it as a bug (or "probably bug").

They haven't contacted me. :(

I hope they read this topic.

Lacito

lacito
04-16-2007, 10:24 AM
I have installed the latest Flash player (9.0.45.0).

Nothing has changed.

In the 4th case (e4x + "leak" xml) it leaks.

Lacito

jsebrech
04-16-2007, 01:54 PM
My experience with reporting bugs to macromedia was that if you didn't have a simple test case (a few dozen lines at most) your bug did not see much in the way of forward momentum.

lacito
04-16-2007, 02:18 PM
I know.

First time I have reported the bug with the source code without testdata.
I have encouraged them to contact me by email for the complete test case.
No reply.

I have reported the bug again placing the url of actionscript.org (and flexcoders) thread in the bugreport.

Silence.

Tink
04-16-2007, 02:53 PM
It may be a known bug they are addressing, were addressing, cannot address, something they don't rate as important as other bugs etc.

I wouldn't be too disappointed by the lack of response.

lacito
04-16-2007, 03:27 PM
Yes, you are right.

The main cause of my disappointment is that this bug hasn't been corrected in the last 2 new versions of Flash player.

I'm convinced that it is a bug. A very weird bug.
The leaking depends on the data (test file). First I couldn't believe it.

If somebody can prove it that I'm wrong, I would be very-very satisfied. :)

I'm not interested in methods and advices. Only in bugs.
Somebody adviced me to filter the data on server-side. In the real application I filter it. These files are only testcases.

But if a flex application is being used for hours and it uses e4x and httpservice with or without server-side filtering then it could "gobble up" the client memory.

jsebrech
04-17-2007, 09:19 AM
The bug I reported was a freeze of the flash plugin (taking the browser with it). That's a denial of service attack.

Ofcourse, they fixed it, but still, the process could have been more informative.

lacito
10-11-2007, 11:03 AM
Now this is a registered bug at Adobe Bug System.
If you use HttpService and E4X, vote for this bug.

http://bugs.adobe.com/jira/browse/SDK-11244

Thanks,
Lacito