Ludii Forum
Block - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Game Problems (https://ludii.games/forums/forumdisplay.php?fid=17)
+--- Thread: Block (/showthread.php?tid=390)

Pages: 1 2


Block - slimy_asparagus - 01-25-2021

I have not been able to load "Block" . I just get these errors:

Code:
Compiled Block successfully.
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    at features.features.Feature.instantiateFeature(Feature.java:466)
    at features.FeatureSet.instantiateFeatures(FeatureSet.java:238)
    at policies.softmax.SoftmaxPolicy.initAI(SoftmaxPolicy.java:524)
    at policies.softmax.SoftmaxFromMetadata.initAI(SoftmaxFromMetadata.java:49)
    at search.mcts.MCTS.initAI(MCTS.java:668)
    at utils.LudiiAI.initAI(LudiiAI.java:80)
    at util.AI.initIfNeeded(AI.java:168)
    at manager.ai.AIUtil.checkAISupported(AIUtil.java:143)
    at app.game.GameSetupDesktop.compileAndShowGame(GameSetupDesktop.java:156)
    at app.loading.GameLoading.loadGameFromName(GameLoading.java:282)
    at app.loading.TrialLoading.loadTrial(TrialLoading.java:184)
    at app.loading.TrialLoading.loadStartTrial(TrialLoading.java:282)
    at app.DesktopApp.loadInitialGame(DesktopApp.java:423)
    at app.DesktopApp.createFrame(DesktopApp.java:407)
    at app.DesktopApp$1.run(DesktopApp.java:188)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
If I delete preferences file, then it loads Surakarta just fine.


RE: Block - DennisSoemers - 01-25-2021

It's running out of memory because our Biased MCTS AI (which is the best AI we have so far in this game, and is hence also used if you select "Ludii AI" as the AI for one or both players) apparently needs quite a bit of memory in this game -- more than your Java process has available. On my machine it works fine, but the process does use close to 2600MB, which is quite a bit more than most games.

Until we get around to fixing it, there are 2 quick solutions you can use:

1) Just make sure to set the AI for both players in the dropdown menu to something other than Ludii AI or Biased MCTS. The game itself should load fine, it's just these AIs that require a lot more memory on this game
2) Launch Ludii.jar from the command line, using the -Xmx VM argument to increase the memory available to the application. Only do this if your computer actually has enough RAM available. For example, you could run the application using something like: "java -jar Ludii.jar -Xmx3G" (this would give 3GB of memory to the application, which should *probably* be enough -- you can increase if your hardware allows)


RE: Block - slimy_asparagus - 01-26-2021

Dennis,

Thanks for the response. I tried Human/Random and I got much the same result. In fact I ended up having to "kill -9" the Java process.


RE: Block - DennisSoemers - 01-26-2021

Huh that's surprising. Did you try increasing the heap size with something like -Xmx3G? By how much? How much RAM does your computer have? Do you have any indication of how much memory the process was using?

If you like, you could run it again with the extra "-XX:+HeapDumpOnOutOfMemoryError" command-line argument. So, something like: "java -jar Ludii.jar -Xmx3G -XX:+HeapDumpOnOutOfMemoryError". If it crashes with an OutOfMemory error, this should create a dump of all the memory contents of the process, I think simply in the same directory that you're running the command from. If you then find a way to upload it somewhere and provide me with a download link, I can inspect the contents. I can't imagine there would be any sensitive data in such a file, but if you prefer, you can also just privately send me such a download link at d.soemers@gmail.com


RE: Block - slimy_asparagus - 01-26-2021

If I am understanding /proc/meminfo correctly I am not sure I terribly fancy increasing Ludii's memory usage:

Code:
MemTotal:        1917400 kB
MemFree:          100940 kB
MemAvailable:     168688 kB
Buffers:           18256 kB
Cached:           249208 kB
SwapCached:        42076 kB
Active:          1145364 kB
Inactive:         473760 kB
Active(anon):    1043388 kB
Inactive(anon):   397920 kB
Active(file):     101976 kB
Inactive(file):    75840 kB
Unevictable:          96 kB
Mlocked:              96 kB
SwapTotal:       1972220 kB
SwapFree:         207200 kB
Dirty:              5916 kB
Writeback:             0 kB
AnonPages:       1310128 kB
Mapped:           210156 kB
Shmem:             89544 kB
Slab:             112844 kB
SReclaimable:      41976 kB

I have the file here: https://drive.google.com/file/d/1pdWgOKZkvaGRYxn4dVwr89gpvzTt925e/view?usp=sharing . I will want to delete this as soon as possible as it is quite big.


RE: Block - DennisSoemers - 01-26-2021

Ok I see. Our current implementation for "boardless" games is not yet very well-optimised in terms of memory, especially for games that also involve Dominoes or other pieces that occupy more than a single position. Since your hardware indeed has a relatively low amount of RAM, I don't see a way in which you can load them properly until we get around to implementing significant optimisations for these games.


RE: Block - xenos1984 - 01-26-2021

Impressive. I just tried Block with two Ludii AI (Biased MCTS) players. I gave it 16GB for a try, and it used more than 8GB. After five dominoes have been played, both players pass and the game ends. Apparently there are two problems, comparing this behavior with the rules: 1. they do not take dominoes from the bag (Is the bag even defined anywhere?), 2. the game ends in a draw (as a consequence). Should they continue drawing dominoes until the bag is empty or one can be played?

I attached a trial.


RE: Block - Eric Piette - 01-27-2021

Hi,

I found many problems in Block yes ;)
I think I fixed all of them now.
That will be in the next release (probably this afternoon/evening).

Regards,
Eric


RE: Block - xenos1984 - 01-27-2021

Hi Eric,

that looks better indeed! Now it plays as I would have expected. Also I noticed that the Ludii AI now shows UCT instead of Biased MCTS, and that the memory consumption is a bit lower (it starts from 2.5GB after loading, and grows to 6.5GB during play.

Best,
Manuel


RE: Block - DennisSoemers - 01-27-2021

How do you make it grow to 6.5GB? I've just watched two UCTs with 1 sec per move playing a bunch of games and it didn't really grow much beyond 2.5GB, definitely not quickly if at all. Though I guess it may be possible that, if you decide to give it a huge heap size upfront through the VM args, the garbage collector may simply not bother to clean up anything. If you give the process significantly less than 16GB or 8GB or 6.5GB or whatever you're giving it, and run the same experiment, I hope that it will actually clean up and not crash?