Author Topic: Failure in Progress  (Read 4507 times)

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Failure in Progress
« Reply #15 on: July 07, 2013, 09:30:39 PM »
If you can consume 14 GB of RAM at once with just a browser and you're not somehow running photoshop inside your browser, there's something very very wrong :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline LordSloth

  • Sr. Member Mark III
  • ****
  • Posts: 430
Re: Failure in Progress
« Reply #16 on: July 07, 2013, 09:33:23 PM »
Have you ever had over a thousand tabs open at once? It adds up. Right now I'm riding low at under 500 tabs open.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Failure in Progress
« Reply #17 on: July 07, 2013, 10:02:31 PM »
As I said: Very, very wrong ;)

When you need a search engine to navigate your browser tabs, because you have a notable subset of the internet in-memory... well, lets hope the tabs don't have a cluster-consciousness threshold.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Cyborg

  • Master Member Mark III
  • *****
  • Posts: 1,935
Re: Failure in Progress
« Reply #18 on: July 07, 2013, 10:27:34 PM »
Thanks for reporting the errors.  They look like bog-standard out-of-memory exceptions but that seems strange, is this a big scenario?

A quick glance shows nothing, but to clarify: are protector starships in this game?


Just curious, but why not take a page out of the shared memory model (lol...) and just allocate 2 GB right off the bat? Make it a configurable option.
Kahuna strategy guide:
http://www.arcengames.com/forums/index.php/topic,13369.0.html

Suggestions, bugs? Don't be lazy, give back:
http://www.arcengames.com/mantisbt/

Planetcracker. Believe it.

The stigma of hunger. http://wayw.re/Vi12BK

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Failure in Progress
« Reply #19 on: July 07, 2013, 10:43:08 PM »
take a page out
Oh ho ho...

Quote
and just allocate 2 GB right off the bat?
I wish we could!  The heap max size is set by the runtime itself, however, and we have no control over it.  Caps out around 800MB or so.

That said, I'm basically to the point where I want to wrapper the "new" operator and possibly the List<T> class and whatever else may be messing with stuff here, and just doing our own memory management to some extent.  The other games don't need it, but AIW does at this point.

Problem is that would take me weeks, and there'd potentially be tons of bugs.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,562
Re: Failure in Progress
« Reply #20 on: July 07, 2013, 10:49:00 PM »
Hooray for native memory management. :D


OMG, that sounds so ugly. :(

Not only would you have to provide what would effectively be a custom new and delete, you would have to "hook it into" the C# managed side so you can allocate an object on that instead. And then you have to worry about how that plays with the GC. (pointers in unsafe blocks probably) Ugh.  :o


Though at this rate, it may be less ugly than convincing the Unity devs to fix up some of this stuff, or at least give you more options.

The Unity engine seems cool, but not giving a hook to set things like heap sizes seems like a major hole. :(



With some really sophisticated, hackish, non-public API abusing, non-portable means, you might be able to "overwrite" how it tracks what the max heap should be like (if it is set explicitly, instead of implicitly like time limits on GC times, and quitting if it hits those limits, in which case you would want to try to find where that time ratio is tracked)
« Last Edit: July 07, 2013, 10:51:32 PM by TechSY730 »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Failure in Progress
« Reply #21 on: July 07, 2013, 10:54:47 PM »
It wouldn't need to be that ugly ;)  I just mean wrappering everywhere we do allocation and trying really, really hard to just allocate what we need up front and issuing those out as needed rather than using "new" itself during normal operation.

If the heap isn't touched, it can't be fragmented or exhausted, after all.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,562
Re: Failure in Progress
« Reply #22 on: July 08, 2013, 12:06:02 AM »
Oh, just "run of the mill" object pooling. Yea, that could work.

Does C# give stronger memory location guarantees than Java?
In Java, just because you allocate 50 instances of X back to back doesn't mean that the runtime will place those 50 instances contiguously. In fact, there is no way to "atomically" request enough room for N instances of whatever in Java without resorting to native code. (Sure, some JVMs are smart enough to realize that similar things allocated around the same time should probably be near each other in memory, but it would be nice to have a stronger assurance than "is you JVM smart?") So while object pooling in Java can save you from too much GC activity due to the new generation heap getting too full, it can't save you from GCs due to memory fragmentation.

Offline The Hunter

  • Full Member Mark II
  • ***
  • Posts: 153
  • H/K Mk5
Re: Failure in Progress
« Reply #23 on: July 08, 2013, 12:45:16 AM »
If anything, i hope that will fix "too many heaps" and related freezes too.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Failure in Progress
« Reply #24 on: July 08, 2013, 09:53:54 AM »
Oh, just "run of the mill" object pooling. Yea, that could work.

Does C# give stronger memory location guarantees than Java?
In Java, just because you allocate 50 instances of X back to back doesn't mean that the runtime will place those 50 instances contiguously.
If you allocate them as an array, I think it's semantically obligated to place them contiguously in memory.  At least, if a runtime took to breaking that rule, their array access time would take a fairly significant hit relative to competitors.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline LordSloth

  • Sr. Member Mark III
  • ****
  • Posts: 430
Re: Failure in Progress
« Reply #25 on: July 10, 2013, 11:20:27 PM »
I have a few more simple things to try regarding this unhandled errors problem, but it is currently processing reliably from my last save at around 3:42 minutes left on the CPA... if I take no action whatsoever. On the other hand, a genocidal killing spree seems to be lightening the burden.

I need to test and see if rebooting, updating patches, various common sense things solves the problem, but I'm not used to fighting at 700 AIP, and keeping AI ships under around 29,000 might end up being a full time job.

Offline LordSloth

  • Sr. Member Mark III
  • ****
  • Posts: 430
Re: Failure in Progress
« Reply #26 on: July 11, 2013, 09:00:46 PM »
I've done some preventative maintenance, and have a couple questions...
Is there any way I can enable cheating (hacking the save file perhaps) mid-game? I would find that 'send in the clowns' code quite handy in preventing more crashes.
Okay, so if I understand this correctly, I can type into chat:
Code: [Select]
cmd:enable cheats
Send In The Clowns
And depopulate the galaxy without having to leave my cozy little den? At this point, I don't know which will be worse- actual AIP or just the game's minimum AIP on waves.

Is there anything in the post 7.001 releases that might ease my problem? I'd prefer to rush this game to completion or clown-hack my way to victory before changing the hacking rules.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Failure in Progress
« Reply #27 on: July 11, 2013, 09:04:34 PM »
Those commands should release a lot of stuff, yes.  You can also use Pull The Lever to release effectively everything, though that may not be your intent :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline LordSloth

  • Sr. Member Mark III
  • ****
  • Posts: 430
Re: Failure in Progress
« Reply #28 on: July 12, 2013, 12:21:48 AM »
I find it a bit odd how that save reproduces the unhandled errors at the exact same time, every time, even after a fresh system boot, if I do nothing.

So I sent out my fleet early, scrubbed out about 500 ships before the CPA hit, which was enough to prevent any unhandled errors.

That CPA is mostly cleared up, it released three thousand or so ships I don't even remember killing half of. So now I'm down to 26,900 or so enemy ships in the galaxy.

Up next: More Spire Cities, Antagonizing the Universe to keep ship counts down, !!fun!!.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Failure in Progress
« Reply #29 on: July 12, 2013, 08:09:53 AM »
I find it a bit odd how that save reproduces the unhandled errors at the exact same time, every time, even after a fresh system boot, if I do nothing.
Just checking: is that save on a mantis record?  If not please put it somewhere I can get it :)  I haven't had a lot of AIW time since the last prerelease but if it's that reproducible I may be able to do something about it.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!