Hi there - Maybe you are not eating enough or not absorbing vitamin B.
My doctor put me on metformin (glucophage) awhile back and my hair began coming out between my fingers in the shower.
I began taking a 600 mcg dose of biotin (200% of RDA - one of the lowest doses on the health food store's shelf) - and my shedding stopped within a week.
Biotin is vitamin b-7 (aka vitamin h or coenzmye R). I've not read about any side effects from supplementation of biotin - and any excess is excreted.
HUGE supplements are available. I went with a 'lower' dose because I don't want my filtering organs to work any harder than necessary in removing the excess. I'm going to need them later.

I've also read that IRON can be a big issue with hair loss - it's easy to get too much or a really upset stomach on it if you take iron supplements - so be wary, I'd shoot for iron-rich foods rather than the pills.
I took one iron pill YEARS ago (prior to hair issue) and it caused me to projectile vomit a silvery substance.
A good way to check for anemia (low iron) would be a blood test with your doctor - before any iron supplementation.