livelycode/aws-lib — Issue #38: memory leak with SQS
Author: bbn
Created: 2012-02-07 00:22:27+00:00
State: open

The coffeescript below results in a steady increase in used memory. Screenshot of debugger profile: http://cl.ly/2f1t3i3e1Q3w0q0b0T3P

#sanity check -- is aws-lib a big memory leak?
require "v8-profiler"

aws = require "./aws-lib"

awsOptions =
host: "queue.amazonaws.com"
path: "/181376977363/test"
secure: true
awsKey = "..."
awsSecret = "..."

sendReceiveDelete = ->
sqs = aws.createSQSClient awsKey,awsSecret,awsOptions
msg = "My lucky number is #{Math.floor(Math.random()*100000000)}."
sqs.call "SendMessage",{ MessageBody: msg }, (result) ->
console.log "SEND: #{JSON.stringify result}"
sqs.call "ReceiveMessage", {}, (result) ->
console.log "RECEIVE: #{JSON.stringify result}"
if result.ReceiveMessageResult
receivedMessage = result.ReceiveMessageResult.Message
if receivedMessage
sqs.call "DeleteMessage", receivedMessage, (result) ->
console.log "DELETE: #{JSON.stringify result}"
process.nextTick sendReceiveDelete

sendReceiveDelete()