hungdluit / flowlib

Automatically exported from code.google.com/p/flowlib
0 stars 0 forks source link

Memory leak when uploading #42

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Upload something
2. When uploading it eats 100Kb per second more memory
3. After upload it dont releases memory.

What is the expected output? What do you see instead?
I think it should release unused memory

What version of the product are you using? ~~(Do not write latest)~~
SVN r526

On what operating system?
Windows 7100

Call Stack? ~~(Line numbers and exception type helps much)~~
After some time it throws OUT OF MEMORY exception.

Please provide any additional information below.
after 5-10 minuets of uploading for different users, my program uses 200-
600Mb of RAM.

Original issue reported on code.google.com by hackw...@gmail.com on 23 Jul 2009 at 4:20

GoogleCodeExporter commented 8 years ago
I have set breakpoints to dispose functions for TcpConnection and 
transfernmdcprotocol
It fires only when program going to shutdown. :-\

Original comment by hackw...@gmail.com on 23 Jul 2009 at 7:50

GoogleCodeExporter commented 8 years ago
OMG when uploading 1Gb+ file at 40 MB/s it trying to allocate 1GB RAM and in
Share.cs GetContent:

buffer = reader.ReadBytes(buffer.Length); - here System.OutOfMemory thrown 

Original comment by hackw...@gmail.com on 24 Jul 2009 at 9:25

GoogleCodeExporter commented 8 years ago
It appears flowlib don't releasing bytes allocated for sending... it stores all 
what 
been sended

Original comment by hackw...@gmail.com on 24 Jul 2009 at 9:31

GoogleCodeExporter commented 8 years ago
I dont know how it is possible - sometimes when uploading i can see upload 
transfer 
wich shows 40-50 MByte/s speed. My network works at 10Mbit FULL DUPLEX, it 
impossible 
to upload with this speed. At this time flowlib allocates uploading file in 
memory. 
If file is too big it will fail.

Original comment by hackw...@gmail.com on 2 Aug 2009 at 2:24

GoogleCodeExporter commented 8 years ago
I think It appears when flowlib receives ADCGET message with big length for 
example 
400 Mb

Original comment by hackw...@gmail.com on 6 Aug 2009 at 2:44

GoogleCodeExporter commented 8 years ago

Original comment by blomman84 on 7 Sep 2009 at 9:20

GoogleCodeExporter commented 8 years ago
Fixed in r532.
Can you confirm this?

Original comment by blomman84 on 7 Sep 2009 at 9:24

GoogleCodeExporter commented 8 years ago
Negative. It dont releases transfers objects. Dispose functions of 
TcpConnection and 
transfernmdcprotocol never fires. After downloading file i got +22 mb of used 
memory 
(~40 sources used). Also I think second sub-issue is not fixed too. Sometimes I 
got 
very big length of ADCGET message (transfernmdcprotocol.cs  line 783) Lenght 
can be 
whole file size (for example - 1 Gb). If it happens flowlib immediately loads 
whole 
file in memory. I fix this by adding condition:                     
if (adcget.Length > 6291456) adcget.Length = 6291456;
I have fix for first issue - in TransferManager.cs void 
trans_ConnectionStatusChange(object sender, FmdcEventArgs e)
I have added call for dispose of transfer if action is disconnect. 
Also you will unable to download quite fast at 100Mbit network if use 1024 
buffer 
size of TcpConnection.

Original comment by hackw...@gmail.com on 8 Sep 2009 at 2:24