Nice library, thanks. Nevertheless, on a long running server, it needs more and more memory.
DataSet attempts to cache DataSet objects by nationality. However, Nationality does not define hashCode/equals. Thus we get a new entry for every newly generated object of type Nationality. And these objects are generated freely e.g. in Generator.generateRandomNationality. So each invocation of Generator.generateRandomUser effectively adds a DataSet to the cache that never goes away. And eventually, heap space is full, no matter how big it is.
Nice library, thanks. Nevertheless, on a long running server, it needs more and more memory.
DataSetattempts to cacheDataSetobjects by nationality. However,Nationalitydoes not definehashCode/equals. Thus we get a new entry for every newly generated object of typeNationality. And these objects are generated freely e.g. inGenerator.generateRandomNationality. So each invocation ofGenerator.generateRandomUsereffectively adds aDataSetto the cache that never goes away. And eventually, heap space is full, no matter how big it is.