Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack Overflow on big seal area #45

Closed
regis9000pro opened this issue Jun 18, 2013 · 5 comments
Closed

Stack Overflow on big seal area #45

regis9000pro opened this issue Jun 18, 2013 · 5 comments

Comments

@regis9000pro
Copy link

Hi
I need to seal a big area but if i increase the maximum radius of the Oxygen Sealer, i've got a Stack Overflow. Did you think it is fixable ?

java.lang.StackOverflowError
at universalelectricity.core.vector.Vector3.getBlockID(Vector3.java:118)
at micdoodle8.mods.galacticraft.core.oxygen.OxygenPressureProtocol.canBlockPass(OxygenPressureProtocol.java:297)
at micdoodle8.mods.galacticraft.core.oxygen.OxygenPressureProtocol.touchingUnsealedBlock(OxygenPressureProtocol.java:314)
at micdoodle8.mods.galacticraft.core.oxygen.OxygenPressureProtocol.loopThrough(OxygenPressureProtocol.java:66)
at micdoodle8.mods.galacticraft.core.oxygen.OxygenPressureProtocol.nextVec(OxygenPressureProtocol.java:100)
at micdoodle8.mods.galacticraft.core.oxygen.OxygenPressureProtocol.loopThrough(OxygenPressureProtocol.java:70)
at micdoodle8.mods.galacticraft.core.oxygen.OxygenPressureProtocol.nextVec(OxygenPressureProtocol.java:100)
at micdoodle8.mods.galacticraft.core.oxygen.OxygenPressureProtocol.loopThrough(OxygenPressureProtocol.java:70)

@thaarok
Copy link

thaarok commented Jun 18, 2013

It require rewrite OxygenPressureProtocol.loopThrough() to not use recursion - save list of blocks to go through into linked list. (But heap, where Objects are saved also arent endless, but it is much bigger.) You can try rewrite it.
(I am now also considering try look at problem with unrelieble sealing, it is anoying to build space stations without oxygen in most of rooms.)

@regis9000pro
Copy link
Author

I'm going to see what i can do but i'm not very good coder.

@thaarok
Copy link

thaarok commented Jun 21, 2013

I have written patch, which overcome Stack overflow, but for maximum length of way from Sealer var5=2000 it works better with current solution. Greater maximum radius of sealer with my solution works, but cause lags. (and room with maximum length of way 1000 is realy big room)
Try it and write how it works for you. It is only set of java sources - copy them to you development eviroment.

https://gist.github.com/honza889/5833688
https://dl.dropboxusercontent.com/u/3377144/GalactiCraft-sealerMaximumPatch.zip

@regis9000pro
Copy link
Author

I've tested, it work for me, its a good rewrite but it cause many lag for me with var5=2000 and if i break the sealed area it make a huge lag. I've written something like this but it didn't work and i didn't know the function Stack.

@thaarok
Copy link

thaarok commented Jun 21, 2013

Unfortunately sealing computation is computationally demanding. When sealer begin sealing in open space (or if somebody breaks the sealed area), this computation must run through fully, which with so big limit cause lag inevitably.
But currently often runs when sealed area wasn't changed.
I suggest:

  • Remove method loopThrough and insert its code into nextVec and checkAtVec into nextVecD. (This saves a lot of possible function calling in stack without need of object Stack)
  • Cut down calling of checkSeal(), sealArea() and unsealArea() from core.tile.GCCoreTileEntityOxygenSealer (currently is checkSeal() called although sealer is turned off)

I post a patch if I will be successful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants