Firefox OS/MappedArrayBuffer: Difference between revisions

Jump to navigation Jump to search
Line 39: Line 39:


== Q & A ==
== Q & A ==
* How to make the file uncompressed and aligned in packaged app?
* '''How to make the file uncompressed and aligned in packaged app?'''
: For keyboard app, put the file |metadata.json| in gaia/apps/keyboard to indicate the file to be memory-mapped, below is an example(see bug 957497 for more information).
: For keyboard app, put the file |metadata.json| in gaia/apps/keyboard to indicate the file to be memory-mapped, below is an example(see bug 957497 for more information).
   {
   {
Line 55: Line 55:
   4541832  Stored  4541832  0% 1970-01-01 08:00 426a7f8e  js/imes/jszhuyin/data/database.data
   4541832  Stored  4541832  0% 1970-01-01 08:00 426a7f8e  js/imes/jszhuyin/data/database.data


* How to know if the array buffer is memory-mapped in an XHR response?
* '''How to know if the array buffer is memory-mapped in an XHR response?'''
: The Content-Type header is "application/mem-mapped" for such response.
: The Content-Type header is "application/mem-mapped" for such response.


* How to check memory usage?
* '''How to check memory usage?'''
: You can check the memory usage by the following command:
: You can check the memory usage by the following command:
   $ tools/get_about_memory.py --no-gc-cc-log
   $ tools/get_about_memory.py --no-gc-cc-log
Line 90: Line 90:
   │      └──0.05 MB (00.25%) ++ (2 tiny)
   │      └──0.05 MB (00.25%) ++ (2 tiny)


: For array buffer objects, you will see "non-heap/elements/mapped" if it's memory-meapped, and "malloc-heap/elements/non-asm.js" if it's memory-allocated.
: Memory-mapped array buffer is reported at non-heap/elements/mapped
: Normal array buffer is reported at malloc-heap/elements/non-asm.js
148

edits

Navigation menu