Pointers/memory issues

This is a discussion on Pointers/memory issues within the C++ Programming forums, part of the General Programming Boards category; Disk cache, holding the program images in memory in case you want to start them again, and so on. Just ...

  1. #16
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Disk cache, holding the program images in memory in case you want to start them again, and so on. Just because memory is used doesn't mean the OS can't make it available for programs.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,918
    Windows likes to hog memory itself for caches and stuff and other things, of course.

  3. #18
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,263
    On Linux, the only resources your program can "hog" after it terminates are disk space (obviously) and SysV shared memory regions. If you create shm regions and don't destroy them before exiting, those regions will stick around.

    EVERYTHING else is always released back to the OS.

    You also have the remote possibility of triggering a kernel bug and crashing a box, but given that these machines reboot so rarely, I suspect the kernels are pretty solid.

    If you are utterly paranoid, you could run everything inside User Mode Linux.

  4. #19
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,263
    Quote Originally Posted by cunnus88 View Post
    Yes, I'm guessing gdb will keep the memory safe.
    Programs running under gdb don't execute any differently than normal. Running under the debugger doesn't make anything safer, really. The debugger is just a process which watches and manipulates another process. It doesn't even slow it down.

    As for shared_ptr, it's a boost object, and I can't install it since I don't have root privileges.
    There's nothing stopping you from using Boost. You don't have to install it in /usr/local...

    Anyway. Especially on Linux there's really nothing to fear. Write code!

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bitmap scroll issues
    By Gerread in forum Windows Programming
    Replies: 4
    Last Post: 05-14-2007, 06:18 AM
  2. Solution to culling issues?
    By VirtualAce in forum Game Programming
    Replies: 4
    Last Post: 03-14-2006, 06:59 PM
  3. Memory Issues
    By Padawan in forum C Programming
    Replies: 12
    Last Post: 04-03-2004, 03:10 AM
  4. Visual Age C++ to MS VC++ conversion issues?
    By Ruchikar in forum Windows Programming
    Replies: 3
    Last Post: 08-10-2003, 10:54 PM
  5. hexdump issues
    By daluu in forum C Programming
    Replies: 2
    Last Post: 03-04-2003, 09:01 PM

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