Thread: [C] Trouble with memory usage

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    161

    [C] Trouble with memory usage

    Hi.. I've written a program that controls if some other program adds or deletes some keys in HKLM\....\Run. If my program finds a mismatch it creates some popups and the user can say : yes modify it, or not, do not modify the reg.

    It works fine. Quite.
    The problem is that it seems to use the memory in a stupid way so it continues to add 8k of memory to his process ( I see it in the Task Manger )... It starts from about 990k then it continues to grow (and work) until it reaches about 3500k so it is no more able (I dont know why!!!) to read the files he worsk with and it stops (it appears an error because it can't open the files).

    I think it is a memory allocation problem or somethign like that.. In the code I allways close the files and register's keys.. or I think I did...

    Can you help me finding out the problem?

    The problem appears even if the program does nothing...I mean if there are NO modifyes in the reg.. I think the problem is in the FileCompare and his child functions.

    Please check the file attached.
    Comments are in italian but the code is not hard to understand.
    Last edited by BianConiglio; 09-28-2004 at 08:30 AM.
    This forum is the best one I've ever seen. Great ppl, great coders

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    161
    Ok I got it, I had to use better

    fclose(namebuffer); // chiudo i files
    fclose(namebackup);

    in the functions I said before
    This forum is the best one I've ever seen. Great ppl, great coders

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Deleting objects show no drop in memory usage.
    By theJ89 in forum C++ Programming
    Replies: 8
    Last Post: 04-02-2006, 06:21 AM
  2. memory usage keeps going up when retrieving webcam image
    By khristopher in forum C++ Programming
    Replies: 2
    Last Post: 03-22-2006, 09:19 PM
  3. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  4. [C] Get the page-size in memory
    By BianConiglio in forum Windows Programming
    Replies: 2
    Last Post: 12-18-2004, 05:12 AM
  5. pointer and memory allocation trouble
    By volk in forum C++ Programming
    Replies: 27
    Last Post: 05-17-2003, 11:14 AM