lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
230 stars 285 forks source link

fixed leak #253

Open jose-d opened 5 years ago

jose-d commented 5 years ago

There is memory leak reproducible in case when Class object instance is ended with some Exception.

Example:

input_dict['non_existing_param'] = 1000  # non existing param will cause exception
class_run.set(input_dict)
class_run.compute()

In this example, Class will complain with an exception bcs. of non-existing parameter, but still few bytes will stay in memory.

Depending on amount of exceptions, hundreds of GBs leak in few days.

With provided patch we observed much better behavior.

Here is graph of memory usage on compute node running code with standard Class: https://www.fzu.cz/~jose/temp/leak_grafana.png (3 days to OOM)

jose-d commented 5 years ago

@lesgourg: hi, what we can do to get this merged? Or UR working on own fix?

lesgourg commented 5 years ago

Sorry, I promise I'll do it asap! Next week I will be working on the code and I'll commit your fix.

jose-d commented 5 years ago

np, thx for info!