question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make JIT cache non-static

See original GitHub issue

Improvement Suggestion

What improvement are you suggesting?

Overview:

On the CPU (ARMeilleure project), the JitCache is responsible for storing the JIT generated code. Currently it is static and has a 2GB region reserved for code of all Translator instances. It should be made non-static, and a instance of the cache should be stored per Translator instance.

This way, we don’t run out of reserved memory if we have multiple Translator instances. Additionally, it makes disposal simpler as one can just dispose the entire cache when the translator is disposed, and the memory can be reclaimed by the OS.

I expect this to be fairly easy to do overall, but it requires the removal of the unwinder that is registered on windows to handle the unwinding of JIT generated functions. See: https://github.com/Ryujinx/Ryujinx/blob/5e724cf24e3d696b95be859c055a617e5d37bf80/ARMeilleure/Translation/JitUnwindWindows.cs#L62

I’m not sure if windows allows removing it, so peharps this part of the code should be kept static.

For anyone interested, I have started some work on this, but I am not working on it right now (and don’t plan to anytime soon), I can make the code available somewhere.

Nature of Request:

Fix/refactoring.

Why would this feature be useful?

Avoids out of memory errors with multiple translators, makes disposal simpler.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Twilight-Strugglecommented, Mar 1, 2021

Let me challenge this. There are concerns because this is my very first attempt to contribute to an OSS project. But I’ll manage to do it somehow.

0reactions
tvoracekcommented, Jan 19, 2023

@Twilight-Struggle Any progress? I see no movement on this issue for over 2 years…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why doesn't the JVM cache JIT compiled code?
I would personally be fine with a "just persist the JIT profiling information between runs" option with all the warnings that "this will...
Read more >
Down the rabbit hole: JIT Cache | devops.lol
It allows you to pre-JIT entire assemblies and install them in a system cache for later use. Other more recent developments are the...
Read more >
Question about a problem with non-static and ...
So the problem is to create a class that implements the FoodService interface using a single cache "FoodItems" using Cachemanager and Cache ......
Read more >
Frequently asked questions about the JIT compiler
The JIT compiler uses memory intelligently. When the code cache is initialized, it uses relatively little memory. As more methods are compiled into...
Read more >
Diff - 960a63e66741f8fed2798c9f1e05d081275ec8b5^2.. ...
int base_flags; - MemMap data_pages; - if (mem_fd.get() >= 0) { - // Dual view of JIT code cache case. Create an initial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found