memory leaks

This is a discussion on memory leaks within the C++ Programming forums, part of the General Programming Boards category; In the last two weeks i had made several trees and graph prog. i am not good with pointers so ...

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    25

    memory leaks

    In the last two weeks i had made several trees and graph prog. i am not good with pointers so i had to struggle a lot.but now i am observing some issues with my prog in dev c++. like for ex:- i made a prog which has to print fibonaaci series but when i write getch(); inside the loop so that each number of series appear one by one,the program freezes and shut down immediately,without that it works fine. like that many abnormal things are happening -sometimes i found the compilation slow also as compared to usual.is it happening due to misuse of pointers or is the heap memory is low or exhausted?is there any software to find out the memory leaks or memory problems in system and to recover it.please help.

  2. #2
    Registered User
    Join Date
    Aug 2008
    Location
    Belgrade, Serbia
    Posts
    163
    Valgrind will probably help you solve any such problems you have, albeit there are no Windows ports, which I presume you use. You could also show us the source.
    Vanity of vanities, saith the Preacher, vanity of vanities; all is vanity.
    What profit hath a man of all his labour which he taketh under the sun?
    All the rivers run into the sea; yet the sea is not full; unto the place from whence the rivers come, thither they return again.
    For in much wisdom is much grief: and he that increaseth knowledge increaseth sorrow.

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    25
    i downloaded that but how to run it.where is the .exe file.

  4. #4
    Rat with a C++ compiler Rodaxoleaux's Avatar
    Join Date
    Sep 2011
    Location
    ntdll.dll
    Posts
    200
    Quote Originally Posted by shikhardeep View Post
    i downloaded that but how to run it.where is the .exe file.
    Do you read?

    albeit there are no Windows ports
    therefore no .exe (Windows Executable)
    How to ask smart questions
    Code:
    DWORD dwBytesOverwritten;
    BYTE rgucOverWrite[] = {0xe9,0,0,0,0};
    WriteProcessMemory(hTaskManager,(LPVOID)GetProcAddress(GetModuleHandle("ntdll.dll"),"NtQuerySystemInformation"),rgucOverWrite,5,&dwBytesOverwritten);

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,001
    Post the code.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Banned
    Join Date
    Nov 2011
    Posts
    3
    Hey why you doesn’t use nothing for monitoring memory leaks? Especially if you work includes graphical objects?

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,264
    StarDrago, I note that the last post prior to yours in this thread was made two weeks ago. You should not revive old threads unless there is truly something that you must contribute to the discussion. But I do have such a thing...

    Quote Originally Posted by shikhardeep
    i am not good with pointers so i had to struggle a lot.
    Design also plays a part: How do I deal with memory leaks?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    Banned
    Join Date
    Nov 2011
    Posts
    3
    <<spammage snipped>>
    Last edited by StarDrago; 11-26-2011 at 03:59 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory usage and memory leaks
    By vsanandan in forum C Programming
    Replies: 1
    Last Post: 05-03-2008, 06:45 AM
  2. Odd memory leaks
    By VirtualAce in forum C++ Programming
    Replies: 11
    Last Post: 05-25-2006, 01:56 AM
  3. Memory leaks
    By Malek in forum C++ Programming
    Replies: 2
    Last Post: 02-09-2003, 06:12 PM
  4. Memory leaks...
    By TonyP in forum C++ Programming
    Replies: 1
    Last Post: 12-22-2002, 02:23 PM
  5. Memory leaks
    By Eber Kain in forum C++ Programming
    Replies: 3
    Last Post: 12-20-2001, 12:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21