Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-312

OutOfMemoryError on upload of video

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 1.4.0
    • 1.6.0
    • cordova-android
    • None
    • Samsung Galaxy S, HTC Wildfire, Droid Bionic

    Description

      I'm attempting to get a video upload to our server to work, but the
      application is crashing with an OutOfMemoryError.

      Video was created with the Capture API and is around 32MB.

      We're seeing this with PhoneGap 1.4.1 on several Android devices: Samsung Galaxy S, HTC Wildfire S, Droid Bionic.

      I've tried setting chunkedMode=true on my FileUploadOptions object
      that I pass with no effect.

      Here's a stacktrace:

      03-10 18:51:03.219: ERROR/dalvikvm-heap(5397): Out of memory on a 8274898-byte allocation.
      03-10 18:51:03.219: INFO/dalvikvm(5397): "Thread-41" prio=5 tid=27 RUNNABLE
      03-10 18:51:03.219: INFO/dalvikvm(5397): | group="main" sCount=0 dsCount=0 obj=0x40604db8 self=0x2c35f0
      03-10 18:51:03.219: INFO/dalvikvm(5397): | sysTid=5535 nice=0 sched=0/0 cgrp=default handle=5205920
      03-10 18:51:03.219: INFO/dalvikvm(5397): | schedstat=( 741088865 766937263 210 )
      03-10 18:51:03.219: INFO/dalvikvm(5397): at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:~91)
      03-10 18:51:03.219: INFO/dalvikvm(5397): at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:216)
      03-10 18:51:03.219: INFO/dalvikvm(5397): at org.apache.harmony.luni.internal.net.www.protocol.http.RetryableOutputStream.write(RetryableOutputStream.java:60)
      03-10 18:51:03.219: INFO/dalvikvm(5397): at java.io.DataOutputStream.write(DataOutputStream.java:99)
      03-10 18:51:03.219: INFO/dalvikvm(5397): at com.phonegap.FileTransfer.upload(FileTransfer.java:324)
      03-10 18:51:03.219: INFO/dalvikvm(5397): at com.phonegap.FileTransfer.execute(FileTransfer.java:98)
      03-10 18:51:03.219: INFO/dalvikvm(5397): at com.phonegap.api.PluginManager$1.run(PluginManager.java:150)
      03-10 18:51:03.219: INFO/dalvikvm(5397): at java.lang.Thread.run(Thread.java:1027)
      03-10 18:51:03.219: INFO/dalvikvm(5397): [ 03-10 18:51:03.239 5397:0x159f E/dalvikvm ]       Out of memory: Heap Size=14215KB, Allocated=7385KB, Bitmap Size=0KB, Limit=20480KB
      03-10 18:51:03.239: ERROR/dalvikvm(5397): Extra info: Footprint=14215KB, Allowed Footprint=14215KB, Trimmed=512KB
      03-10 18:51:03.239: WARN/dalvikvm(5397): threadid=27: thread exiting with uncaught exception (group=0x400205a0) 03-10 18:51:03.289: ERROR/AndroidRuntime(5397): FATAL EXCEPTION: Thread-41
             java.lang.OutOfMemoryError: (Heap Size=14215KB, Allocated=7385KB, Bitmap Size=0KB)
             at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:91)
             at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:216)
             at org.apache.harmony.luni.internal.net.www.protocol.http.RetryableOutputStream.write(RetryableOutputStream.java:60)
             at java.io.DataOutputStream.write(DataOutputStream.java:99)
             at com.phonegap.FileTransfer.upload(FileTransfer.java:324)
             at com.phonegap.FileTransfer.execute(FileTransfer.java:98)
             at com.phonegap.api.PluginManager$1.run(PluginManager.java:150)
             at java.lang.Thread.run(Thread.java:1027)
      

      Attachments

        Activity

          People

            agrieve Andrew Grieve
            nathanlvsnap Nathan Levesque
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: