|
|
Darren New <dne### [at] sanrrcom> wrote:
> Tom Austin wrote:
> > I would check to see if there is a 'file' for the specific process that
> > reports the current memory usage.
> The problem with that approach is you're just polling. There's no good
> way to find the max memory usage if you only use that much for 1/100th
> of a second.
This is a real bummer. I would have wanted accurate memory usage
statistics for the small project I have been making, but it seems to
be impossible.
If anyone happens to be interested, it's this:
http://warp.povusers.org/FSBAllocator/
From all the tests I have made regarding the memory usage I'm pretty
confident that with the list-of-ints example my allocator uses half the
memory as the default allocator of libc, but I can't tell for sure
because of all these unknowns, as well as some erratic behavior I noticed
during my tests. Thus I couldn't add this statistic to the page,
unfortunately.
It's interesting, though. Sometimes C++ *can* actually be slower than
some other languages, and the reason may be in the memory allocator used
by the compiler (or, more specifically, by the standard C libraries).
It's not really so much a fault of C++ per se, but more a fault of the
system library tasked on the memory management.
Using a more efficient memory allocator can cause amazing speedups, as
I wrote on that page.
--
- Warp
Post a reply to this message
|
|