An old saying goes that if you have an army, it will want to fight a war.
That seems to be true also for our personal army, our immune system: there seems to be various pieces of evidence that many of the allergies and/or autoimmune diseases some of us have to deal with arise from an under usage of the system, which then devotes its energies to fight the body hosting it.
Let's assume that the above is true, and consider the situation on a generation ship, ensuring a proper shielding from cosmic radiation and providing adequate gravity by the usually accepted means, aka rotating habitats.
The generation 0 will be a ground-raised one, thus with the possibility of interacting with a highly diverse environment. But all individuals starting from generation 1, though not exposed to a perfectly sterile environment, will be dealing with a fairly monotonous environment for the immune system and thus have greater chances of developing allergies or autoimmune diseases.
What is a suitable system to keep the immune system of the passengers at a fair usage level so that adverse effects can be prevented?
Considering that resources (space, energy, water, oxygen, ...) are scarce, preference will be given to those proposals which make a leaner usage of them.