RGB to HSV conversion function destroying my Pixelblaze?

Ah apologies, I actually did a search on the forum but failed to find this topic. Sorry.
On a more general topic, I understand it creates an array for every call because we return an array every time ? It which means it completely saturates the RAM of the ESP32 and leads to a crash/heating ?

Is there a way to purge the variable once used, or force the code to use always the same array ? I can see returning an array from a function could be useful. Sorry if it’s a basic question.

Thank you