In order to compare various sorting algorithms, I am looking for a way to see how much peak memory a function uses. Figuring out the time they take to complete is easy, but this has stumped me. Anyone have a clue?
Name:
Anonymous2006-11-29 1:49
valgrind or wrap that shit yo
Name:
Anonymous2006-11-29 2:08
Thanks for the heads up on valgrind. Guess i shoudla clarified, I need to get the memory usage from inside the program itself, not an outside tool.
Name:
Anonymous2006-11-29 4:37
Unfortunately, the C/C++ standard library is crap and does not include a standard function to determine free/used memory (Keep it portable! Maybe some platform doesn't use memory!). You'll need to check for either a non-standard function provided by your compiler (look for mem, core, memory, free, etc.) or a function provided by your OS (careful with that though; prefer private bytes to working set size). Then you measure memory used before running the stuff, and the maximum of the memory used in each iteration.
Name:
Anonymous2006-11-29 4:39
>>4
BTW, I forgot to clarify: concentrate on used memory. "Free" memory is not a simple concept in virtual memory OSes. Even used memory can include or exclude shared memory (for you it'll be the same) and it can refer to the total size of your virtual memory map (not too accurate for you), the private bytes used by you (this is what you need), the working set (in-RAM bytes) used by you (careful with this), and the swapped bytes (out of RAM bytes from your virtual memory space, not useful for you).
Name:
Anonymous2009-01-14 13:54
FAGGOT
Name:
Anonymous2009-01-14 13:57
WHY DONT U KEEP A RECORD EVERYTIME U NEW AND DELETE
Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy