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

FEATURE: Deal with the low memory limits. #665

Closed
dsvensson opened this issue Jul 19, 2022 · 4 comments
Closed

FEATURE: Deal with the low memory limits. #665

dsvensson opened this issue Jul 19, 2022 · 4 comments

Comments

@dsvensson
Copy link
Collaborator

dsvensson commented Jul 19, 2022

Modern maps may need to start ezquake with -mem 256 rather than the default. While this might seem trivial I spent an hour helping out two players with adding that command line parameter via voice. One Windows and one MacOS user. It may sound odd that people don't know what command line parameters are, but that's just the way it is apparently.

The simple solution would be to just increase the limit like other engines already have. Another solution might perhaps be some 2x resize or some other resize strategy if the map hits the limit until it loads, and let the OS oom-killer slay the process if it gets out of hand.

If I'm interpreting the FTE source code correctly it looks like -mem was removed in 2013 in favor of dynamic allocation as needed.

@Calinou
Copy link
Contributor

Calinou commented Jul 19, 2022

Defaulting to -mem 256 should work fine on machines with 4 GB of RAM or more (maybe 2 GB if you're diligent with how your OS uses the rest of the RAM). This could be a reasonable solution for now.

@inf1niti
Copy link

inf1niti commented Jul 19, 2022

IME, it's still possible to get crashes even with a higher heapsize allocation - but this has only happened to me while loading multiple large maps, and when warping between them throughout the course of a night of games. So there may also be some issues around bspfile cleanup between map loads.

It's also worth noting that any memory increases would need to be implemented on the MVDSV side as well.

Beyond global memory allocation, there are a number of issues IME with unexpectedly small limits, or strange bugs when trying to render more complex maps:

  • textures larger than 640*480 throw a sys_error (many common SP wads these days contain 1024x1024 textures).
  • hard-coded limits are present in bspfile.h, client.h, and common.h headers which cause various load problems if any of these limits are exceeded (even if they fall within the limits imposed by the bsp29 format, and are properly rendered in other engines). Is it possible to utilize a dynamic allocation strategy for these instead?
  • a number of memory checks were implemented to resolve memory corruption bugs flagged in BUG: Memory corruption bugs in map parser #615, which impose integrity checks on bsp29/29a map formats. If a map fails any of these checks, they will not load. But the maps I've seen flag these errors load and run just fine in other engines...
  • maps with large/complex lightmaps, or with variable texture scales/lmscales can cause strange lightmap issues in ezquake which are not present in other engines.

Obviously, ezQuake is a great engine and these modern maps aren't the main use case we see from day-to-day, but it would be nice if we were able to align the engine's loading capabilities more closely to the other quake engines in use these days, so we can benefit from improved performance & more details in our maps. 👍

dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Aug 8, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation.
dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Aug 28, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation.
dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Aug 28, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation.
dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Aug 28, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation.
dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Aug 31, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation. This at least allows modern maps to load.
dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Sep 1, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation. This at least allows modern maps to load.
dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Sep 2, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation. This at least allows modern maps to load.
dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Sep 15, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation. This at least allows modern maps to load.
dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Sep 15, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation. This at least allows modern maps to load.
dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Oct 5, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation. This at least allows modern maps to load.
dsvensson added a commit to qw-ctf/ezquake-source that referenced this issue Oct 6, 2022
Stop gap fix for QW-Group#665. Could include some detection of memory to avoid
allocating 256MB if system is puny. Ideal solution would be dynamic
allocation. This at least allows modern maps to load.
@tcsabina
Copy link
Collaborator

@dsvensson
Does #674 fix all mentioned issues here? Can we close this?

@dsvensson
Copy link
Collaborator Author

Lets, better to add specific issues for what's left @inf1niti

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

4 participants