Skip to content

Crashed to upload large files ( > 500MB): [Terminating app due to uncaught exception 'NSMallocException', reason: 'Failed to grow buffer'] #146

Closed
@nikolaytsigvintsev

Description

@nikolaytsigvintsev

Hi.

I'm trying to upload a large file. My application crashes after launching the upload with the error:

  • Terminating app due to uncaught exception 'NSMallocException', reason: 'Failed to grow buffer'

On a small file size works well.

iPad Pro
Deployment Target : 12.1
React-Native v0.58

Code:

      const upload = new tus.Upload({ uri: 
        `${RNFS.DocumentDirectoryPath}/images/${item.image}`}, {
        endpoint: 'http://192.168.1.5:1080/files/',
        retryDelays: [0, 1000, 3000, 5000, 10000, 15000, 20000],
        resume: true,
        metadata: {
          name: item.image,
          filetype: item.image.substring(item.image.lastIndexOf('.') + 1).toUpperCase(),
          copyright: 30
        },
        onError: (error) => {
          console.log('Error upload:', error)
        },
        onProgress: (uploadedBytes, totalBytes) => {
          console.log(`Progress: ${uploadedBytes / totalBytes}%`)
        },
        onSuccess: () => {
          console.log('Upload URL:', upload.url)
        }
      })
      upload.start()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions