oooh how much fun recursion is...

This is a discussion on oooh how much fun recursion is... within the A Brief History of Cprogramming.com forums, part of the Community Boards category; So I was doing this project for school which requires a lot of recursion (and i mean a lot). Some ...

  1. #1
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738

    oooh how much fun recursion is...

    So I was doing this project for school which requires a lot of recursion (and i mean a lot). Some test files take up to 20 minutes to complete because of how much recursion is involved. (Right now we are purposely coding it with lots of recursion, and soon we will optimize our programs).

    Well, I was testing my program on a test file, and it was taking ages to complete. So I decided I wanted to know exactly how much memory my program was taking up.

    I had SSH'd into a Linux machine from my Windows machine, and so the program was actually running on the Linux machine and not mine, although I was watching it from my machine.

    So I walked down the hall to the Linux lab at my school and logged onto the machine that I was SSH'd to from the Windows lab. I then proceeded to check the system stats.

    CPU usage was at 100%.
    Swap file usage was increasing at 1 MB per second on average.
    Memory usage was at 746 MB out of 754 MB total.

    So then I decided to go cut execution of my program from my Windows machine and come back and check the new system stats. When I came back system stats were:

    CPU usage was at 3%
    Swap file usage was down from 221 MB to 34 MB and staying steady.
    Memory usage was down to 134 MB and staying steady.

    The funny thing is my program wasnt running infinitely...it was actually solving the problem and DOES end if you let it run long enough.
    My Website

    "Circular logic is good because it is."

  2. #2
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    Wheeeeeeeeee.
    Do not make direct eye contact with me.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Template Recursion Pickle
    By SevenThunders in forum C++ Programming
    Replies: 20
    Last Post: 02-05-2009, 08:45 PM
  2. Recursion
    By Lionmane in forum C Programming
    Replies: 11
    Last Post: 06-04-2005, 12:00 AM
  3. a simple recursion question
    By tetra in forum C++ Programming
    Replies: 6
    Last Post: 10-27-2002, 09:56 AM
  4. stack and recursion help needed!
    By LouB in forum C++ Programming
    Replies: 3
    Last Post: 07-01-2002, 02:19 PM
  5. selection sorting using going-down and going-up recursion
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 11-02-2001, 01:29 PM

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