Fabric type changes the problem
Synthetic activewear can retain body oils and odor more stubbornly than some natural fibers. Turn garments inside out when appropriate so the wash liquor can reach the areas that contact skin most heavily.
Wash promptly
Do not leave sweaty garments compressed in a gym bag or damp pile for long periods. Check the care label, pretreat when the product and fabric allow it, and use a cycle suitable for the soil level.
Use the right amount of detergent
More detergent is not automatically more cleaning. Follow the product's dose for the load and washer and leave enough room for the garments to move and rinse.
If odor remains after washing
Rewash before using a heated dryer. Dryer heat is not a substitute for removing odor-causing residue. Make sure the garment is fully dry before storage.
Garment care labels, appliance manuals and laundry-product directions can be more specific than a general guide. Use them when they set a tighter limit.