-
-
Notifications
You must be signed in to change notification settings - Fork 11
Fix OOM error #4
Comments
OOM error can still occur, but data aborts are no longer thrown. |
Applet mode RAM restrictions are well known, and impossible to bypass without a patch in atmosphere or other CFW. The best you can do is make it throw a "this won't work, launch in game mode" error instead of crashing. |
OOM in "The Question" did not occur before I made an update to libnx. Even if not using album override, the application can still run out of memory when large assets are loaded over a period of time. |
sounds like a memory leak then. Given that python is garbage-collected, a core dump should be able to piece together what filled the RAM. I'll take a look with twili when I have the time. |
The following warning appears in the log:
A couple of OOM tracebacks:
The following could be possible:
|
On Linux, I used a test project with various large images, audio, and music, and looped it for five minutes. Memory usage started at 529688 (title screen, before start) then ended at 1906304 (title screen, after start). It may be possible to get the amount of available memory by using size_t mem_available;
svcGetInfo(&mem_available, InfoType_TotalMemorySize, CUR_PROCESS_HANDLE, 0); , size_t mem_used;
svcGetInfo(&mem_used, InfoType_UsedMemorySize, CUR_PROCESS_HANDLE, 0); , struct mallinfo mi = mallinfo();
size_t heap_available = mi.uordblks; and struct mallinfo mi = mallinfo();
size_t heap_used = mi.fordblks; , but I haven't tried it out yet. I may just do the following:
Python object allocator |
For some reason, the heap size is randomized... Check out https://gist.github.com/uyjulian/df5e5c44a8304ba17536609f0358ac0a for how I determined this |
I may try to use |
Need more confirmation that |
Nope… In fact, |
It looks like heap is limited to 384 MiB, so there's not much I can do right now until PhysicalMemory SVCs are implemented… |
Out of memory error occurs, preventing large assets from being loaded and "The Question" from being run in album override.
The text was updated successfully, but these errors were encountered: