Sockets dying with heavy memory use
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Sockets dying with heavy memory use

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Sockets dying with heavy memory use

    I have an app that runs a server (CLI) on a Windows 2008 Server. It runs a standard listen socket with max sockets and works great until someone uses a large number of system resources (Remote Desktop in, Team Source Explorer, etc.). Then the app stops responding on the port, but still is running. I can run it as either a Windows Service or as a Console App, but the problem is still there. Sometimes it calls the accept() then dies right away.
    Anyone with any ideas why this is happening? This is a license server for a product, and we cannot have this dying all of the time.
    Thank you.
    -Erik

  2. #2
    Join Date
    Jul 2012
    Location
    n/a
    Posts
    3

    Re: Sockets dying with heavy memory use

    that's very interesting

  3. #3
    Join Date
    Mar 2001
    Posts
    2,366

    Re: Sockets dying with heavy memory use

    Have you checked to see if the program is leaking memory? I had a .net app that was leaking memory somehow, through the socket construct. When it ran out of resources, it would do the same thing and die on accept. I think that this is just a symptom of whatever malady is eating you memory. Have a look in the system resources with Task Manager. Look at your process, and watch the memory consumption, does it fluctuate? Then connect to it with a remote session and see what happens. Is it possible to remote debug this app?
    ahoodin
    To keep the plot moving, that's why.

  4. #4
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Re: Sockets dying with heavy memory use

    Thanks for the response.

    I finally rewrote it using a single thread rather than the multiple threads that had before. Haven't had a crash in two weeks now. So you are right, it probably was too much memory use.

    -Erik

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center