Skip to content

Tag: caching

Caching java instance for peformance

Please assist, What is meant by caching this line/new instance in java for example: I know I have to store insome sort of memory… may someone show me an example. Thanks. Answer Caching means don’t let the garbage collector trashing your variable after you use it, if you already know that you will …

Java method should cache the results

I’m learning programming in the language java. I need to write an application that takes a string and returns the number of unique characters in the string. It is expected that a string with the same character sequence may be passed several times to the method. Since the counting operation can be time-c…

False sharing and volatile

Good day, I recently found an annotation introduced in Java 8 called Contended. From this mailing list I read what is false sharing and how annotation allows objects or fields to allocate an entire cache line. After some research I found that if two cores store the same cache line and one of them modify it th…