A fine-grained instance used for efficient sharing
Flyweight pattern is used when there is a need to create a large number of objects of almost similar nature.
The large number of objects consume a large amount of memory and the flyweight design pattern provides a solution for reducing the load on memory by sharing objects.
It is primarily used to reduce the number of object creation, to reduce memory footprints and increase performance.
This pattern tries to reuse the existing similar kind of object by storing them and creates new object when no matching object is found.