Odin
Odin copied to clipboard
Odin Compilation Freezes System
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
- Operating System & Odin Version: Windows 11, dev-2023-01:f5984637 (latest commit as of 1/31/2023, 10:00 am)
- Please paste
odin reportoutput:
Odin: dev-2023-01:f5984637
OS: Windows 11 Professional (version: 22H2), build 25281.1000
CPU: AMD Ryzen 7 4800H with Radeon Graphics
RAM: 16302 MiB
Current Behavior
I have a very large array in my program that used to compile, but no longer does.
When compiling, my computer almost completely freezes. The mouse is hardly movable and extremely choppy, freezing frequently for a couple of seconds at a time, sound of music playing starts cutting out a bit, and everything slows down dramatically. If I wait long enough, I get this error:
Out of Virtual memory, oh no...
Requested: 8396800 bytes
Total Usage: 45359235072 bytes
C:\Users\krixa\Odin\src\common_memory.cpp(150): Assertion Failure: `pmblock != nullptr` Out of Virtual Memory, oh no...
Large static arrays, produce huge executables, I always allocate dynamicaly. You will always have problems with that, as they have to bi initialized in any language compiler, even assembler.
What is the code that produces this?
@gingerBill The problem seems to just be that I have a very large array literal using a slice type (citiesList := []City { // info here }). I had already posted this github issue before remembering that I had this. Anyways, I would probably expect the compiler to just error out on array literals that are too big to compile instead of freezing the system. Although, the previous version of Odin was actually able to compile the program. It's not a huge issue as I intended to replace this large array with something else anyways (parsing from the file and appending to an array is way too slow with the amount of information the program needs, so it will have to be something else other than that).
@bmaxa Thanks. Yeah, I am actually aware of the issues with large static arrays, but sometimes I just want to get things done quickly, especially when testing or prototyping something.
You could use #load to embed it and then @(init) to initialize that cities list on startup.