In parsemutations post treatment, use a "sliding window":

Instead of calculating reproductive success of everybody at final generation, we calculate it over NGEN generations.
Because we can not store the whole simulation in reproductive_success_bygen (size of nb_gens*nb_indivs*nb_future_gens = too big), we divide the treatment in several step of size STEPGEN.

So for each step, we consider STEPGEN+NGEN generations (so even for the last generation we have NGEN future generations to consider).

The value of STEPGEN won't change the output. The lower it is, the more cpu and the less memory we will use. So a good strategy would be to decrease it when we have more individuals.
Approximately: memory used is O[(STEPGEN+NGEN)^2*nb_indivs], cpu use is O[(total_gen/STEPGEN])*(STEPGEN+NGEN)*nb_indivs].
replace STEPGEN and NGEN macros by run-time parameters, and fix a small bug (when no offspring, gen_bigger_reproductive_success should be -1)