In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
How to analyze Flex memory leak common phenomena and solutions, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
Summary of common techniques for Flex performance optimization
As we all know, at present, domestic broadband applications are not as developed as many developed countries, and the bandwidth of personal applications is basically less than 2m. How to make your Flex applications run smoothly on the client has become a big problem restricting every Flex application development programmer. Here, I have collected and sorted out the experience in this area on the Internet. You are welcome to add it.
Examples of Flex memory leaks:
1. Reference disclosure:
Null is required for references to sub-objects and external references to this object or sub-objects.
two。 System class disclosure:
Use the system class and forget to do delete operations, such as BindingUtils.bindSetter (), ChangeWatcher.watch () function after the end of the need to call ChangeWatcher.unwatch () function to clear the reference, otherwise the object using this function will not be deleted; similar to MUSIC,VIDEO,IMAGE,TIMER,EVENT,BINDING and so on.
3. Effect leakage:
When applying the effect Effect to the component, when the object is deleted, you need to stop the Effect animation on the object and sub-objects, and then set the target object of Effect to null;. If you do not stop the animation and directly set the Effect to null, the object will not be removed normally.
4.SWF disclosure:
To completely delete a SWF, call its unload () method and set the object to null
5. Picture leaked:
Set the source to null; (for testing) when the Image object is finished.
6. Voice and video leaks:
When you don't need a music or video, you need to stop music, delete objects, and set null by reference.
Flex memory leak workaround:
1. Garbage handling in the REMOVED_FROM_STAGE event return of the component (remove all external references (whether VO or component need to be deleted), delete listeners, call the cleanup method of the system class)
Remove before setting null to ensure that all external references of objects after remove or removeAll are released cleanly.
two。 Using Flex's performance optimization tool Profile to monitor the project process, you can know which objects have been created in history, which objects have not been deleted, the number of objects created, the proportion and amount of memory occupied, the creation process and other information.
Summary:
The key is to do a good job of cleaning, you should remember to delete the references you set, and the system classes you have used should remember to do a good job of recycling. If the above problems are solved well, it is possible to be automatically recycled by the system without the need for a custom forced collector.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.