Users Pricing

forum

Home Forums Do static members help memory efficiency? – MindStick

Do static members help memory efficiency?

Anonymous User 2137 20 Jul 2015

If I have a class that I expect to be used in thousands of instances in a memory-sensitive application, does it help if I factor out static functionality to static members?

I imagine that static methods and variables are stored once per class while for non-static members there has to be something stored for each instance.

With member variables, it seems quite clear, but what kind of data is stored for methods?


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md