|
I am running a version of my game using the -batchmode flag on a windows (VPS) server. It runs perfectly well for the first few hours but over a period of about 8 hours consumes my entire CPU Usage. I am not sure where to start to look for the culprit causing this.. (the 'output_log.txt' file gets quite large but surely writing to that can't be the culprit??) any tips on the sort of thing i should be looking for in my code would be greatly appreciated cheers andrew
(comments are locked)
|
|
Start by checking the machine's memory usage at that point. Is it significantly higher than when you started the process? How's the pagefile usage looking? "Surely X can't be the culprit?" are famous last words. For instance, your logging probably does a lot of string concatenation and formatting. If you're doing that sub-optimally - for instance, using the + operator instead of a stringbuilder and string.Format - the resulting allocation and destruction of strings could have an effect on Mono's less-than-ideal garbage collector (see these two articles). While StringBuilder is not always faster, it's memory fragmentation that you should care about the most. While I'm not saying that logging is the culprit, it's a good example of things that might be non-obvious at first but where you want to start checking your memory allocation and usage patterns.
(comments are locked)
|
|
There is most likely a leak somewhere in your games code. I would reccommend asking on the unity forums for more help. No reason why he couldn't get help finding it here, actually.
Apr 22 '10 at 12:09 AM
Ricardo
I know, but the forum has a lot more traffic, and with a problem like this I just figured it would be better in the forums :o.
Apr 22 '10 at 05:32 PM
KHopcraft
(comments are locked)
|

Hi Andrew, did you find the cause of your troubles? A follow up comment might be useful for future reference. Cheers!