I think this is the kind of commit that gets you kicked out of the b0rker
club. nice work!

On Fri, Feb 8, 2013 at 8:51 AM, Guillaume Friloux <
[email protected]> wrote:

> This patch changes the way we use the internal buffer attached to any
> Ecore_Con_Server.
>
> Before this patch, this internal buffer was getting freed only when all
> the data was sent.
> In an async environnement, where you can get in a state that you
> constantly have data to send, this buffer will always grow, and so never
> reach the free(), which will lead you to the kernel oom killer.
>
> A patch was already added by zmike in the past to get more control over
> this by adding the ECORE_CON_EVENT_SERVER_WRITE which allows you to track
> the data actually given to write(). But in the case you never have the
> total buffer to be written, it never gets frees, and so you cant have a
> control on its size, the only work-around is to stop your app, waiting for
> the buffer to reach 0 len.
>
> This patch doesnt change ECORE_CON_EVENT_SERVER_WRITE, but it will sync
> the size of the internal buffer to what you can calculate in your app using
> ECORE_CON_EVENT_SERVER_WRITE. So it sticks to reality, and allows you send
> files larger than your free memory, without dirty patches (if you already
> have dirty patches, they will still work!)
>
>
> I provide a test app, that i used this way :
> - It takes the file to send as a param.
> - It will connect to 127.0.0.1 port 5555 (TCP) to send it.
>
> So you can use netcat to test it, by doing : nc -l -p 5555 -vvv > file
> Then launch the test app : ./main 5G
>
>
> I made test with a 5GB file (my comp has 4GB of ram and 4GB of swap), i
> also provide the results :
>
> Without the patch :
>
> > time ./main 5G
> real    13m57.093s
> user    0m3.400s
> sys     1m35.950s
>
> > valgrind --tool=massif ./main 5G
>     Attached file massif.out.11858.before
> http://www.images-host.fr/view.php?img=09020847before.png
>
>
> With the patch :
>
> > time ./main 5G
> real    9m46.773s
> user    0m25.172s
> sys     1m25.424s
>
> > valgrind --tool=massif ./main 5G
>    Attached file massif.out.21863.after
> http://www.images-host.fr/view.php?img=09020848after.png
>
> On 08/02/2013 09:35, Enlightenment SVN wrote:
>
>> Log:
>> Improving ecore_con_server_flush to avoid a faceplant over the OOM
>>    Killer when sending big files. I will explain more in a mail comming
>>    after this commit.
>>
>> Author:       kuri
>> Date:         2013-02-08 00:35:27 -0800 (Fri, 08 Feb 2013)
>> New Revision: 83766
>> Trac:         http://trac.enlightenment.org/e/changeset/83766
>>
>> Modified:
>>    trunk/efl/src/lib/ecore_con/ecore_con.c
>>
>>
>>
>
>
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
>
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to