On Tue, Sep 3, 2013 at 2:19 PM, jeevan kk <[email protected]> wrote:
> I have checked the heapdump after making some https calls. I have noticed
> some Buffers are not been released. This is doesn't happen when I use http.
That's not unexpected. The tls module (the https module is built on
top of it) uses some buffers internally that don't get released right
away.
> Here is the sample program
>
> var Heapdump = require('heapdump');
> var https = require('https');
>
> var doneCount = 0;
> var maxCount =250 ;
> var calls = function() {
> var options = {
> hostname: 'www.google.com',
> port: 443,
> path: '/',
> method: 'GET',
> agent: false
> };
>
> var req = https.request(options, function(res) {
> res.on('data', function(d) {
> process.stdout.write(d);
> doneCount++;
> });
> });
> req.end();
>
> req.on('error', function(e) {
> doneCount++;
> console.error(e);
> });
>
> };
>
> for(var i=0;i<maxCount ; i++){
> calls();
> }
>
> setInterval(function(){
> if(doneCount == maxCount){
> global.gc();
> Heapdump.writeSnapshot();
> process.exit(1);
> }
>
> }, 1000);
What do the deltas (the diffs) between snapshots look like?
You don't need to call gc() by the way, heapdump does a global GC
before writing the snapshot.
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
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].
For more options, visit https://groups.google.com/groups/opt_out.