Randomtest fatal error at 4000+ iterations, it can be fix?

Hi, I have kind of a problem running the randomtest, it only appears when I set to run it around 4000 or 5000 times and it gives this error:

How many times would you like to run randomtest? [10] 5000
Starting seed number? [0]
Avoid used options? It's less random, but it finds bugs faster. (y/n) [y]
Show full text? (y/n) [y]
Write output to a file (randomtest-output.txt)? (y/n) [y]

<--- Last few GCs --->

[7896:00000000027E74A0]   202702 ms: Scavenge 1376.1 (1427.8) -> 1368.7 (1430.3)
 MB, 2.6 / 0.0 ms  (average mu = 0.210, current mu = 0.188) allocation failure
[7896:00000000027E74A0]   202725 ms: Scavenge 1376.3 (1430.3) -> 1368.8 (1432.8)
 MB, 2.4 / 0.0 ms  (average mu = 0.210, current mu = 0.188) allocation failure
[7896:00000000027E74A0]   202753 ms: Scavenge 1376.6 (1432.8) -> 1369.0 (1434.8)
 MB, 2.4 / 0.0 ms  (average mu = 0.210, current mu = 0.188) allocation failure

<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 00000330192879E0]
Security context: 0x0352d731e6e9 <JSObject>
    1: byteLength(aka byteLength) [00000239758F9479] [buffer.js:~509] [pc=000003
301960B310](this=0x01d40dd026f1 <undefined>,string=0x02ed1522bc41 <String[43]\:
 \x2022 \x2605 I'm done \n \x2022 I want to choose again. \n>,encoding=0x0352d73
3e2e1 <String[4]: utf8>)
    2: arguments adaptor frame: 3->2
    3: fromString(aka fromString) [0000031140893251] [bu...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaS
cript heap out of memory
 1: 000000013F6DDD8A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506
 2: 000000013F6B8886 node::MakeCallback+4534
 3: 000000013F6B9200 node_module_register+2032
 4: 000000013F9D30DE v8::internal::FatalProcessOutOfMemory+846
 5: 000000013F9D300F v8::internal::FatalProcessOutOfMemory+639
 6: 000000013FBB9804 v8::internal::Heap::MaxHeapGrowingFactor+9620
 7: 000000013FBB07E6 v8::internal::ScavengeJob::operator=+24550
 8: 000000013FBAEE3C v8::internal::ScavengeJob::operator=+17980
 9: 000000013FBB7B87 v8::internal::Heap::MaxHeapGrowingFactor+2327
10: 000000013FBB7C06 v8::internal::Heap::MaxHeapGrowingFactor+2454
11: 000000013FCE1B2B v8::internal::Factory::AllocateRawWithImmortalMap+59
12: 000000013FCE45DD v8::internal::Factory::NewRawTwoByteString+77
13: 000000013FA2F618 v8::internal::Smi::SmiPrint+536
14: 000000013F9C66EB v8::internal::StringHasher::UpdateIndex+219
15: 000000013F9EBB06 v8::String::Utf8Length+22
16: 000000013F6A1C3C node::Buffer::New+4332
17: 00000330192879E0
Presione una tecla para continuar . . .

At 3000 it works fine (haven’t tried all the way up to failure so it’s between 3001 to 4000).

My doubt is if there’s a way to fix that error to run the game a higher number of times. I also want to save the output on a .txt to check the variables on all the playthroughs.
If the program crashes because it is not able to handle the huge amount of data, could be possible to fix it making the program save the output on several files once it reaches certain size?, just a thought but no idea if it it is possible or how to implement it.

Thanks for your help!

Well… is there a reason why you’re trying to run it 5000 times?

I really don’t see how it’s necessary to run it any more than 1000 times at most.

CoG only runs it 100 times to calculate the average playthrough length/word count.

I would like to track some variables at certain points of the game, know what maximum and minimum values they reach and if there’s any that is not on the range that it should. I did it manually at first but that’s pretty much impossible now. Debugging is another reason too, I have found errors that the quicktest doesn’t show (I think that they appeared around 9000 iterations). With the combination of stats and ramifications that the game has I don’t know how much different paths there could be in total but 1000 is just a really small number.

1 Like

Well, one solution would be, run it 3000 times each, but start each run at the seed number the last run ended at.

So, first run, start at seed 0. Second run at seed 3000. Third at seed 6000, and so on.

After each run, make a copy of the output file so you’ll have a record of all the seeds the randomtest plays.

Yes, That’s what I was doing, but I was hoping to just open the program once and leave it running as many iterations as I wanted without having to be constantly watching over to copy the files and re run it again and again. I mean, I don’t think that what I ask is something impossible to achieve, I guess that the program could make a separate file after X amount of iterations naming the files progressively to not overwrite them, I just don’t have any idea of how I can do that myself, that’s why I’m looking for help here. Thanks for the suggestion.

Yeah I’m not at all familiar with editing/changing the randomtest program.

Sorry I can’t help further. Good luck!!

The problem was solved thanks to the program created by @Sargent, instead of having the whole text at the output making the program use a lot of memory and collapse he made it possible to have only the variables saved to a .csv file. this is the post explaining how to use it. So all credits go to him.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.