Project

General

Profile

Feedback #2037

Excessive number of writes to output_log.txt

Added by MSalters almost 11 years ago. Updated over 8 years ago.

Status:
Closed
Severity:
Low
Assignee:
-
Category:
Gameplay
Target version:
-
Version:
Platform:
Any
Expansion:
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

Description

output_log.txt will rapidly fill up if you put KSP to the background while it loads. The message is
HandleD3DDeviceLost HandleD3DDeviceLost: still lost Skipped rendering frame because GfxDevice is in invalid state (device lost)

Worse, this file is written 1 byte at a time! (Observed via SysInternals Process Monitor). And then after each single-byte write,
another I/O is done to check the file (reason unknown). This means that each byte incurred 2*4KB in I/O, an 8192 times amplification.
The file is already a megabyte as I look, so this bug caused 8 Gigabyte of disk I/O.

Unfortunately, the main reason I put KSP in the background while loading is precisely because the I/O is already so excessive.

Suggested Fix 1: System.IO.BufferedStream
Suggested Fix 2: Don't report every single skipped frame.

History

#1 Updated by TruePikachu almost 11 years ago

I can confirm that it complains in the BG while loading, best workaround currently known is to not BG it.

There is a good chance it is unbuffered because, if it crashes, the data might not get written to disk.

#2 Updated by Ted almost 11 years ago

  • Tracker changed from Bug to Feedback
  • Severity changed from Normal to Low

Whilst this can be irritating to those that alt-tab elsewhere in the game, you shouldn't be minimising KSP during initial asset loading as this causes issues with missing chars in the game.
Regardless, thanks for the report.
Marked this as Feedback as the output is not unintended behaviour.

#3 Updated by TruePikachu almost 11 years ago

I think that the main "problem" here isn't the message or output, but rather the repeated open/write1byte/close which is resulting.

Someone needs to check if this applies to all logging, or only to the asset load. If it applies to everything, it is likely to bottleneck quite easily (as it takes some kernel time to open and close files, as well as some user time to establish handles). My logging setup (Process Monitor) lags me too much to be useful in checking.

(Also, note that I said Process Monitor; that actually does direct event logging which can be reviewed later, without requiring constant alt-tabbing.)

EDIT: Sorry, thought you had said Process Explorer in first message, not Monitor. Sysinternals needs to come up with more distinctive names :P

#4 Updated by TriggerAu over 8 years ago

  • Status changed from New to Needs Clarification

#5 Updated by TriggerAu over 8 years ago

  • Status changed from Needs Clarification to Closed
  • % Done changed from 0 to 100

No Longer an issue

Also available in: Atom PDF