Skip to content

Memory leak, somewhere on Stateless #1

Description

@ghostbar

Hi Niels,

I have been using this for quite some time (like one month) and started to have memory leaks. Some times it completed the task (specially at the beginning) but finally there was a huge memory leak that made my app that uses top 73MB go to +1GB on RAM if launched to Stateless.Messages.Create in parallel.

This is the prototype I was using to launch this. I know the way the prototype is structured is not the issue because now I'm doing the request by myself with request in that very same prototype, just changed groupme with a request call.

SMSController.prototype.sendMessage = function(id, message, callback) {
  var self = this,
       gm = require('groupme').Stateless;

  if (id == null || id === '') {
    self.app.log.error("sms/ctrl#sendMessage: there's no id for sending the message");
    return callback(new Error("There's no ID for sending the message"));
  }

  self.app.log.debug({
       data: {
         id: id,
         message: message
       }
     }, "sms/ctrl: sending message");

  if (message.source_guid == null) {
    message['source_guid'] = 'supposedlyanuniqueidentifier';
  }

  return gm.Messages.create(this.app.vars.groupme.token, id, { message: message }, function(err, response) {
    if (err) {
      self.app.log.error({ data: err }, "sms/ctrl#sendMessage: ");
      return callback(err);
    }
    self.app.log.debug(message, "sms/ctrl: message sent");
    return callback(null);
}

FWIW: node v0.10.17. Tested on MacOS X and Linux.

Kind regards.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions