don't know if this has something to do with your problem:
client.on('data', function(data) {
debugger;
var dataToPipe = data;
httpChild.stdin.write(dataToPipe,'utf8');
httpsChild.stdin.write(dataToPipe,'utf8');
// data = null; tried using this but made no difference.
});
data is already a Buffer and you don't need to pass the encoding to
write-calls. After a short look into Writable Stream implementation i think
it might be even dangerous.
Am Mittwoch, 16. Januar 2013 23:24:22 UTC+1 schrieb preetam pattanashetty:
>
> Hi,
>
> Firstly, what we have is a Windows service (Christened: Aggregator )
> written in .Net that processes data in real time and is listening to
> clients (which are flash based) on a port.. and when a tcp connection is
> made is starts writing data to the client at 4 times a second. This data
> is used by the flash player to plot an almost real time graph.. we use this
> to get feedback on some event from users using their mobile devices.
>
> Why nodejs? One of the issues we had was the flash clients were not able
> to connect to the raw tcp socket when the clients were behind a corporate
> firewall and doing some investigation we found socket.io to solve this
> issue. We are now able to establish a connection from flash based client to
> socket.io (nodejs) to the aggregator.
>
> Now the problem:
>
> When the nodejs app continues running we see a gradual increase in the
> memory footprint. I added nodetime profiler to see what was hogging the
> memory and the objects that are taking up most of the space are of type
> Buffer (native) and Array and I am not sure if this is something internal
> or I have to change the way I am accessing the ‘data’ event of then net
> module.
>
> Source:
>
> The main js file:
>
> https://www.dropbox.com/s/k1u0jg8jl3271m1/mainApp.js
>
> Js file that had socket.io implementation and is started as child process.
>
> https://www.dropbox.com/s/dq1m294xhae70o7/httpChild.js
>
>
>
> A dummy app that simulates the aggregator server (sends dummy data to the
> connected clients on a regular interval):
>
> https://www.dropbox.com/sh/qtgj9gp0h1g7erz/OeQjp3vBBg
>
> Even when I comment out all the code in the net module’s ‘data’ event
> handler of the main js file I still see an increase in the memory. Not sure
> if there is a way to dispose the data object received by this event.
>
> Any help / advice is highly appreciated.. I am new to nodejs and do not
> have any experience in C++.. Thanks again in advance for your time. Please
> let me know if more information is required.
>
>
> Thanks,
>
> Preetam
>
> screenshots from nodetime
>
> <https://lh4.googleusercontent.com/-jQaYcvnkFz4/UPcoFZ-7rpI/AAAAAAAAAEM/byODtLMQweM/s1600/ss1.jpg>
>
>
>
> <https://lh5.googleusercontent.com/-Yy6acm8HnMM/UPcoR5yyaaI/AAAAAAAAAEU/PWjyKYgq9Ok/s1600/ss2.jpg>
>
> <https://lh5.googleusercontent.com/-Yy6acm8HnMM/UPcoR5yyaaI/AAAAAAAAAEU/PWjyKYgq9Ok/s1600/ss2.jpg>
>
>
>
>
>
--
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