View memory-report in B2G Desktop

Source: Internet
Author: User

Currently, Firefox OS is mainly intended for the low-end mobile phone market, while low-end memory is very small. In such a hardware environment, it is harsh for application developers, especially in the memory, OOM is possible if you don't pay attention to it. Therefore, you must always pay attention to the memory consumption during application development and testing.

B2G now provides a memory testing tool. Next, we will briefly introduce how to use this tool in B2G_DESKTOP in linux.

Start your B2G_DESKTOP simulator first

Open a terminal tool and run the command

Kill-34 $ (pidof b2g)

In the kill command, the value after-34 is the Command reserved by the operating system for the application. The b2g uses the-34 command to generate a memory-report.

If the b2g process is killed after you run this command, Your b2g tool version is too low and you need to upgrade it to a newer version.

After the command is run successfully, multiple memory-report-* .json.gz files are generated in the/tmp directory.

Run commands

Gunzip/tmp/memory-report * .json.gz

Decompress all of them. After decompression, multiple memory-report *. json files will be generated. These are the memory-report files applied in b2g.

Memory-reports are json data, which is ugly. You can use the tools provided by firefox nightly build to view these memory reports.

Open firefox nightly build, enter "about: memory" in the address bar, click "read reports from a file" in the following buttons, and select the json file decompressed, you can view the application memory report in the following format:

Click to view the chart

Memory_report sample report download: http://chyblog-chyblog.stor.sinaapp.com/wp-content/uploads/2012/11/memory_report.zip

This report mainly looks at the explicit section and expands the tree directory to see more detailed information.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.