RogueMaster / flipperzero-firmware-wPlugins

RogueMaster Flipper Zero Firmware
https://www.patreon.com/RogueMaster
GNU General Public License v3.0
5.31k stars 543 forks source link

ram/ Memory problems #1105

Closed helix19880 closed 1 month ago

helix19880 commented 1 month ago

Description of the feature you're suggesting.

Sort of new at programming so I'm more or less just gonna give you the code and say here this is my idea. Hopefully we can implement it to solve some of these problems. the NFC Reader has a Constant crash and creates an available memory problem. So I wrote a simple. ram cleaner slash cache cleaner. And more or less just needs to be refined a little bit. and targeted. Hopefully this at least lights up a light bulb. and gets us in the right direction so we can be On our way to having memory issues A thing of the past I'm sure there's some way where this could be automated in the background. If anything, just to create a better quality of life while playing with the flipper zero And I do believe this will be a new function.

include

include

include

include

void clean_ram() { // Simulate RAM cleaning by freeing unused memory printf("Cleaning RAM...\n"); fflush(stdout); // Perform garbage collection or memory optimization here // Placeholder for actual memory management code printf("RAM cleaned successfully!\n"); }

void clear_cache() { // Simulate clearing cache files printf("Clearing cache files...\n"); fflush(stdout); // Placeholder for actual cache clearing code // You can add specific functions to delete cache files as needed printf("Cache files cleared successfully!\n"); }

int main(void) { printf("Starting RAM cleaner and cache clearer...\n"); clean_ram(); clear_cache(); printf("RAM cleaner and cache clearer finished.\n"); return 0; }

RogueMaster commented 1 month ago

Enlightening 😆 If only it were this simple

RogueMaster commented 4 days ago

It should run out of memory much less now