Platinum Rift II - Memory contraints?

Does anyone know if there any constraint on how much memory we are allowed to use?
With the addition of Fog of War, my programs keeps randomly crashing right at the beginning of the match with the following error:

  ghc: out of memory (requested 1048576 bytes)

(when I say randomly, it means on 10 runs on exactly the same map (manual mod, same seed, same starting positions, etc.), about 7/10 will crash while the others work perfectly).

So, is there really a 1MB constraint on how much heap we can use? (If so, I find it terribly low, especially for languages with a lot of dynamically allocated objects). In the rules, there is only the mention of the 200ms rule.

I’d also like to know with which options the programs are compiled, and how they are run, so it is possible to reproduce the environment locally (it is impossible to find that kind of bugs on the IDE without profiling).
In my case, I’m interested in the Haskell parameters (-O ?, +RTS -M1m ?)

Best,

Hi,
I only know theses specs :

http://www.codingame.com/faq

But I hope it will help you.

It seems it’s actually the compiler that runs out of memory while trying to compile my code :frowning:
It’s strange as sometimes it compiles, and sometimes not (the same code). Even more strange is that on the arena, it works for some fights and not for others (I suppose the program is compiled only once…)
I’ll try to investigate more but it is very hard with the limited info :frowning:

Hi,

You’re right, the Haskell compiler runs Out Of Memory with your code.
Ghc is known to use a lot of memory.

Next week, the available memory will increase from 512MB to 768MB, this should solve your problem.

In the meantime, you can try to simplify your code.

Keep coding :smile:

OK, at least I understand more about the problem.
I already tried to simplify my code (when I thought it was my program that was running OOM), but I don’t know enough of ghc to understand what causes it to use so much memory. Maybe in the future… :slight_smile:

I still don’t understand why on the “Arena” some of my fights “work” while others don’t. You surely do not recompile the program for each fight do you???

Hi!

Some maps have less than 50 zones, some have almost 500.
Choosing wrong data structure, or using too much recursive functions could lead to Out of Memeory easily on large maps.

Have fun! ^^

The culprit is really the compiler here. It does not matter whether the map was 20 or 500 zones.

For the Arena, program are actually recompiled each time before a match, which explains the random behavior I have.

For the Arena, program are actually recompiled each time before a match, which explains the random behavior I have.

Whoou, this is a huge avoidable resource waste…