question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upload bigger Videos

See original GitHub issue

Hello everyone,

I am able to upload a video of 9mb. But bigger files cause the heap to run out of memory. Tested with 50-200mb. Same thing happens after I changed the memoryStorage to diskStorage. Also tried set flags to increase the old_space_size and the max_executable_size. But I am pretty sure I do not need to increase those for 200mb files.

Node version: 8.1.2 Multer version: 1.3.0

<--- Last few GCs --->

[7310:0x102801600]    39367 ms: Mark-sweep 1399.7 (1428.2) -> 1399.7 (1429.2) MB, 802.3 / 0.0 ms  allocation failure GC in old space requested
[7310:0x102801600]    40348 ms: Mark-sweep 1399.7 (1429.2) -> 1399.7 (1429.2) MB, 781.4 / 0.0 ms  allocation failure GC in old space requested
[7310:0x102801600]    41324 ms: Mark-sweep 1399.7 (1429.2) -> 1399.7 (1428.2) MB, 777.7 / 0.0 ms  last resort 
[7310:0x102801600]    42312 ms: Mark-sweep 1399.7 (1428.2) -> 1399.7 (1428.2) MB, 987.9 / 0.0 ms  last resort 


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x245960b29891 <JS Object>
    2: decode [/Users/oliverj/github/ganescha/Ganescha-Proxy/node_modules/busboy/deps/encoding/encoding.js:~897] [pc=0x14ac97314469](this=0x1f3446a42061 <a TextDecoder with map 0x3583de3ee5d1>,bytes=0x2907e0182311 <undefined>,options=0x2907e0182311 <undefined>)
    3: arguments adaptor frame: 1->2
    5: decodeText [/Users/oliverj/github/ganescha/Ganescha-Proxy/node_modules/busboy/lib/utils.js:...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 4: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/local/bin/node]
 5: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
 6: 0x14ac9700437d
 7: 0x14ac9744ac53
 8: 0x14ac97314469
 9: 0x14ac9700579b
10: 0x14ac970e886b
11: 0x14ac970baffc
Abort trap: 6
const multer = require('multer');
const upload = multer({ 
    storage: multer.memoryStorage(),            
    limits: {  
         fieldNameSize: 1000,
          fieldSize: 500 * 1024 * 1024, 
          fileSize: 500 * 1024 * 1024, 
          files: 1 
     }
}).single();
    
function extendTimeout (req, res, next) {
    res.setTimeout(480000, function () {
        GL.log('Timeout for /upload');
    });
      
    next();
}
    
function delegate (req, res) { 
    upload(req, res, function (err) {
         /* cut */
    });
}
    
return app.post('/upload', extendTimeout, delegate);

Thanks for any help

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
oliverjessnercommented, May 23, 2019

Hey totally forget this is still open we swichted to socket.io for uploading videos a long time ago.

0reactions
emma-worgucommented, Sep 23, 2020

Hey, My video got uploaded but is not showing on my code editor as pictures would normally show

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upload videos longer than 15 minutes - Android - YouTube Help
Increase your video length limit By default, you can upload videos that are up to 15 minutes long. Verified accounts can upload videos...
Read more >
Enabling Longer Videos In YouTube
By default, YouTube allows video uploads that are up to 15 minutes long. If you try to upload videos longer than 15 minutes,...
Read more >
How to Send Large Video Files (3 Easy Ways) - Animoto
1. Upload videos to a cloud storage ... Using a cloud storage space like Google Drive, Dropbox, or OneDrive to share your video...
Read more >
How To Send Large Video Files In 2023 - MASV
This guide details 6 easy ways to send large videos (20 GB or higher) with pros and cons for each method. Read the...
Read more >
Send Long Videos Without a Video Compressor - Dropbox.com
Simply upload the video file within the Dropbox app, create a shared link, and send it to anyone via email, chat, or text....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found