A couple of things to consider:
Depending on what state you are in, it may or not be illegal to carry in a state park. The whole national park thing seems to be in flux again.
How far do you plan to be hiking? Even a Glock with a extra mag will be close to two pounds, which if you are hiking any distance will be in addition to water, food, first aid, etc. Weight is the enemy. What you may not notice on your hip in the city you will definitely feel at the end of a long day of hiking.
As has been said many times, bear attacks are very rare. I live near the Great Smoky Mtns. and we have had one fatal bear attack in something like twenty years. And there are a LOT of bears in the park, and a LOT of people.
As for me, when I choose to carry while hiking, I normally pack a S&W 351PD: 7 rounds of .22 magnum, 10.5 ounces. If I ever have to use to defend myself it is, "Better than a pointy stick." One of the primary reasons I carry is to signal if I break an ankle, (I usually hike alone.), and it is certainly loud. I know it is a compromise, but one I'm willing to live with.