Memory damage

Posted on 2004-10-24
Last Modified: 2010-04-01
Hello experts.
I am curious about the possible long term effects on memory. How much damage can be done by c++ using dynamic memory? I understand that there can be memory leaks using new and malloc if not freed but that doesn't seem long term. That can be fixed by a basic reboot, correct? Is it possible to do major/long term damage that can affect computer performance such as corrupt windows files, hardware, (I've read some things about stack/heap damage)? If it's possible to do serious damage, what would cause it and how do I prevent it?
T. Loughlin
Question by:paintlrd
    LVL 5

    Accepted Solution


    Each program you make runs as a process.. And when a process is created a chunk of memory if allocated for that process... for its code... for its stack ...for its heap... etc. So the affect of memory leak remains as long as your program /process runs....

    No memory leak won't do any hardware curroption or curropt your Operating system (Windows)... It only hinder the performance of your system.... So your system might ruin slow in case of memory leak..... But if the process is terminated, which is causing the memory leak, then the machine will come back to normal state....


    Author Comment

    Even if there is an access violation?
    T Loughlin

    Assisted Solution

    Access violation will automatically stop your application. For the above mentioned memory leak issues, killing of the process will do & no need tyo restart the sytem for that
    LVL 22

    Assisted Solution

    It all depends on how well the operating system was written.  if they overlooked some things, it's very possible to use up some system resource, such as a system file table, or to fil up the disk.    The better systems check every request you make and try to make sure you are not requesting too much of some resource.

    Just going by anecdotes, it seems Kinux is very good at checking, as many Linux systems run for months and years without requiring a reboot.   On the other hand, Solaris and Windows NT have in the past had major memory leaks, requiring frequent reboots to reclaim lost memory.

    LVL 22

    Expert Comment

    Sorry, meant to type "Linux", not "Kinux".

    Also the program's language doesnt have much to do with this question, you can request memory, files, and other resources from most any language.


    Author Comment

    Thanks guys. You all had a part in answering so I split it between all of you. I appreciate it.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Hire Top Freelancers to Complete C++ Projects

    Source the talented Expert Exchange community
    for top quality work on your C++ projects.

    Hire the best. Collaborate easily. Get quality work.

    Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
    Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
    The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
    The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now