RAM use optimization