Memory performance question
Hello
I need to know what is preffered regarding memory usage :
1) using static methods or using non static methods
2) using static members or using non static members
because from a test a made, it seems that a combination of using static methods and non static members, is the best choise and leaves the biggest memory size in the JVM - which is very strange because i know that using statics is not a good practice in OO .
thanks
Both of them is OK with me, the question is which of them is beter to work with, in a meaning of MEMORY usage,thanks :)
you should be choosing static or non-static on the basis of how the method or attribute is used in the object, not its memory footprint.RAM is cheap; good design is not. use the design that best models your problem, and set your JVM settings for GC and memory accordingly.%
> Hello
> I need to know what is preffered regarding memory
> usage :
> 1) using static methods or using non static methods
> 2) using static members or using non static members
>
> because from a test a made, it seems that a
> combination of using static methods and non static
> members, is the best choise and leaves the biggest
> memory size in the JVM - which is very strange
> because i know that using statics is not a good
> practice in OO .
>
Then either your test design or the implementation (and probably both) is flawed.