DebugViewPP icon indicating copy to clipboard operation
DebugViewPP copied to clipboard

limit maximum memory usage, history limit broken.

Open janwilmans opened this issue 10 years ago • 0 comments

  1. We could use a circular buffer for this, default boost implementation, since old information maybe overwritten. However, if that would require allocation of the whole buffer at the start, that is probably not a good solution.

  2. we could limit the maximum number of lines stored by the LogFile class, this way we would not limit the memory by an exact amount of MB's but an amount of lines instead. We can consider, using an average of 10 lines per 1K, which is statistically,about right when using GoogleSnappy. This would mean, if a 100MB limit is requested, 1.000.000 lines would be stored instead of monitoring actual memory consumption.

  3. we could monitor the amount of private bytes, ProcessInfo::GetPrivateBytes(), this is not ideal, because a ClearLog() is not guaranteed to return memory to the OS.

  4. we could offer a no-memory mode, that just works from disk, it would be slower maybe, but in VM's (where memory is typically scarce) it is probably fine. And once we have the circular-buffer, all disk-io would be in the background anyway.

See also #109

janwilmans avatar Feb 04 '14 15:02 janwilmans