[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Garbage collection best practices
- From: HyperHacker <hyperhacker@...>
- Date: Wed, 27 Jul 2011 16:11:18 -0600
On Wed, Jul 27, 2011 at 11:59, Patrick Rapin <toupie300@gmail.com> wrote:
>> I did some load tests on a lua program (a *C* program that uses different
>> Lua VMs, each on its own thread) and I've seen memory increasing to around
>> 1Gb (possibly my Window's memory limit or something), and then falling
>> quickly to 64Mb or so.
>
> Just to be sure: you are not running your program using Visual Studio
> in "Debug" mode, right?
> Because in this case, the memory consumption can grow up *much* higher
> than in Release mode.
> In Debug mode, to help debug memory related errors, "free" and similar
> functions do not return blocks to the system.
> So the application memory footprint can only grow over time. Or so I
> have observed.
>
>
I wrote a simple server as well and found that what worked best for me
was to do a full collection cycle once per second. If I let it go on
its own, the app would hang for several seconds every so often as it
collected many objects at once. (Though I suspect the __gc for those
objects is taking far longer than it should...)
--
Sent from my toaster.