A recent study has explained that the generation of new memories in the human immune system doesn't come at the cost of old ones.

But the human immune system doesn't appear to be constrained by such space limitations. In a longitudinal study of college students, Kristin Hogquist and colleagues at the University of Minnesota Medical School found that acute infection with Epstein-Barr virus (the cause of infectious mononucleosis) triggers the activation of memory T cells specific for other viruses. But these cells did not multiply or die—their numbers remained the same over time.
Thus human memory T cell numbers simply build up over time. Whether this has a beneficial or detrimental effect on immune responses remains to be seen.
Source-Eurekalert