-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Confirm by changing [ ] to [x] below to ensure that it's a bug:
- I've gone though Developer Guide and API reference
- I've checked AWS Forums and StackOverflow for answers
- I've searched for previous similar issues and didn't find any solution
Describe the bug
When you repeatedly upload file stream to S3 using upload
method it infinitely increases memory usage of Node.js process.
Is the issue in the browser/Node.js?
Node.js
If on Node.js, are you running this on AWS Lambda?
No
Details of the browser/Node.js version
v12.13.0
SDK version number
v2.558.0
To Reproduce (observed behavior)
Run this code:
const AWS = require('aws-sdk')
const fs = require('fs')
const http = require('http')
const credentials = new AWS.Credentials({
accessKeyId: '......',
secretAccessKey: '........'
})
const S3 = new AWS.S3({
credentials,
region: 'eu-west-1'
})
http.createServer(async (req, res) => {
const stream = fs.createReadStream('./test.mp4')
await S3.upload({ Bucket: 'test', Key: 'test', Body: stream }).promise()
res.end(JSON.stringify(process.memoryUsage(), null, 2))
}).listen(1234)
As you send requests to this server memory will infinitely increase.
I am using small video file, but you can use any file.
petersg83, ayazaslam, hatemalimam, MyColorfulDays, molandim and 6 more