Results 1 to 9 of 9

Thread: memory cost of bidir

  1. #1
    kan
    kan is offline Registered User
    Join Date
    Oct 2005
    Posts
    9

    memory cost of bidir

    Hi, We are evaluating bidir.
    I notice that the simple demo client will cost nearly 4M ram. and after implementing bidir in our app. the memory cost also increases nearly 4-5M ram.

    Why bidir will increase so many RAM? can we reduce it? since the memory cost metrics is critical to our app.


    Thanks
    Kan
    Kan Pang
    http://www.chinaTMN.com
    network management with ICE

  2. #2
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    In order to provide you with support you must fill out your signature as detailed in this post http://www.zeroc.com/vbulletin/showthread.php?t=1697

  3. #3
    kan
    kan is offline Registered User
    Join Date
    Oct 2005
    Posts
    9

    Thumbs up memory metrics of bidir demo

    I notice that the initial memory cost of bidir client is nearly 4M ram, but after running 1 hour, the memory decreased to 800K. very interesting!
    can anyone explain the reason?

    and i tries to run 2000 clients concurrently, and set Ice.ThreadPerConnection=1 property.

    the server runs very well, untill the thread.cpp reports out of memory.
    But I notice there is still memory available.

    Any how, I really appreciate the performance of ICE bidir. It's a great work!

    Thanks

    Kan
    Kan Pang
    http://www.chinaTMN.com
    network management with ICE

  4. #4
    kan
    kan is offline Registered User
    Join Date
    Oct 2005
    Posts
    9

    bidir demo metrics

    as many guys told me the concurrent sockets opened by a process is limited by the OS.

    I tested bidir demo in XP(SP1), and seems that 1024 is not the limit.
    can anyone tell me the concrete maximum number for windows OS?

    Kan
    Kan Pang
    http://www.chinaTMN.com
    network management with ICE

  5. #5
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    There is a FAQ in the latest connections regarding memory management under XP that will help answer your memory question. I suspect the problem you are running into with the bidir demo and 2000 connected client is related to running out of handles, not running out of sockets.

  6. #6
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    My colleague pointed that its most likely actually the size of all of the thread stacks that is causing the memory to run out. 2000 connected clients with thread per connection means 2000 threads. 2000 threads each with the default amount of stack space probably exceeds the 32 bit address space. You should lower the default stack space per thread (Ice.ThreadPerConnection.StackSize) and it may resolve this issue -- temporarily at least.

    Why are you using thread per connection anyway?

  7. #7
    kan
    kan is offline Registered User
    Join Date
    Oct 2005
    Posts
    9
    Thanks Matthew for your prompt reply.
    I do not mean to use thread per connection anyway.
    My primary purpose is to verify the concurrent connection limit of bidir.
    Orignially I use Ice.ThreadPool.Server.Size=10. But I noticed that when the number of clients increased, the server will run low of thread pool.
    that's why I use thread per connection instead.

    Kan
    Kan Pang
    http://www.chinaTMN.com
    network management with ICE

  8. #8
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    Note that if you go over FD_SETSIZE (which we set to 1024) sockets then you will run into problems with the thread pool as well.

    If you need more than this many connected clients concurrently then you should rebuild Ice yourself and change the value of FD_SETSIZE in the compiler preprocessor flags.

    Keep in mind that if your clients are busy your server will probably not be able to process that many clients at a time anyway...

  9. #9
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Quote Originally Posted by kan
    Thanks Matthew for your prompt reply.
    I do not mean to use thread per connection anyway.
    My primary purpose is to verify the concurrent connection limit of bidir.
    Orignially I use Ice.ThreadPool.Server.Size=10. But I noticed that when the number of clients increased, the server will run low of thread pool.
    that's why I use thread per connection instead.

    Kan
    Does it really matter for your application if the thread pool runs low on threads? The only situation where it does matter is if you use nested callbacks, because then it is possible that a call blocks indefinitely if not enough threads are available to service the nested callback.

    If you don't have such nested callbacks, I recommend to simply disable this warning, or to set Ice.ThreadPool.Server.SizeMax to the same value as Ice.ThreadPool.Server.Size. See the user manual for further information.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 09-11-2010, 09:47 PM
  2. can i find out the time cost for a connect?
    By cncrazyzz in forum Help Center
    Replies: 1
    Last Post: 08-18-2009, 03:51 AM
  3. Bidir Sample deadlock
    By vincei in forum Comments
    Replies: 9
    Last Post: 07-06-2007, 09:49 AM
  4. IceGrid and bidir
    By albertods in forum Help Center
    Replies: 1
    Last Post: 11-18-2006, 02:47 PM
  5. problem with demo bidir
    By kan in forum Help Center
    Replies: 5
    Last Post: 10-31-2005, 02:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •