I've been facing an issue with an old website that keeps crashing due to running out of memory. The problem seems to be caused by storing data locally and then displaying it, leading to a memory overload. I'm looking for ways to optimize these statements to reduce memory usage. Any suggestions on how I can achieve this?
localStorage.setItem("levels", JSON.stringify(__levels));
localStorage.setItem("rooms", JSON.stringify(__rooms));
var proj = JSON.parse(localStorage.getItem("levels"));
var rooms = JSON.parse(localStorage.getItem("rooms"));