• Acolyte of the Butterfly
    Acolyte of the Butterfly
    deka
    Posts: 136 from 2013/2/12
    From: Hungary, Kecsk...
    Quote:

    asrael22 wrote:
    Ta.

    I've developed a small tool that connects to a server socket someplace and sends some data via HTTP.
    That is done every 30 seconds.
    After a day or so the memory of the system has decreased quite a bit. 1/3 of 512 MB.
    I'm assuming it's my tool that's eating up the memory, although I've tripple checked that each AllocVec, strdup, etc. is freed.
    For each of those HTTP requests there is a sequence of things:
    - memory allocated for request and response
    - socket opened
    - data send over
    - socket closed
    - memory freed

    How could I check where the memory is used?
    Would it be better to allocate some memory upfront for the request/response and also keep the socket open until the application is closed?
    What is the suggested approach for a long-running application?


    Manfred



    I had similar problem while developing a project. I have written a simple library, which traces the memory allocations/freeings and usage too. Maybe, you could do something similar.
  • »03.04.17 - 10:18
    Profile