getDeviceStorage yields OOM



4 years ago
11 months ago


(Reporter: andre.jaenisch, Unassigned)


Firefox Tracking Flags

(Not tracked)




4 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36

Steps to reproduce:

In my Alcatel OneTouch Fire running Firefox OS v1.3 I inserted a 32 GiB SD card which is almost full (30 GiB).
I can open any app searching my SD card: PDF viewer, File Manager, Firetext etc.

Actual results:

After I get some results (lucky case) the app crashes.

While searching the SD card, the UI is unresponsive (synchronous call?). I assume an OOM.

Expected results:

I'd like to have a paging mechanism or the option to load only N bytes into memory, whereby N is defined by the app developer.
This way a reasonable value can be set for the hardware.
Otherwise GiB of data seem to be loaded into MiB of RAM …

Comment 1

4 years ago
As tested a few minutes ago, Firetext managed it to not crash.

However, I'd like to specify the API further.
One way to handle this might be to implement a "deep" parameter for DeviceStorage.enumerate(). If "deep" is "true," then DeviceStorage.enumerate() will return the contents of the directory specified by "path," and the contents of its sub-directories. If "deep" is "false," DeviceStorage.enumerate() will only return the immediate children of the "path" directory.

"deep" could default to "true" to be backwards-compatible.
See Also: → bug 1104337

Comment 3

3 years ago
The "deep" option is a real need!

Comment 4

11 months ago
Firefox OS is not being worked on
Last Resolved: 11 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.