Hi Karim,
have you tried req.once('end', ...)?
http://nodejs.org/api/events.html#events_emitter_once_event_listener
- Phillip
On Thursday, February 12, 2015 at 2:07:42 PM UTC+1, karim elsafy wrote:
>
> hi,
> I have a problem on my code, that some variables never deleted/released. I
> tested it using heapdump. for example:
>
> var app = express();
> app.post("/myURL", function(req, res){
> var reqBody = new Buffer(0);
> req.on('data', function (data) {
> data = new Buffer(data);
> reqBody = Buffer.concat([reqBody,data]);
> });
>
> req.on('end', function () {
> // use the reqBody and
> // in some callbacks do the following line
> res.send("OK");
> });
> )};
>
> here I found that variable reqBody never released (with some variables in
> on end method) and the memory is grown for large data.
>
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/2e3eecd4-c284-426d-a02e-a8af64839147%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.