Co-reflection and “not just passively waiting and dwelling, but really trying to grasp the problem better” is important because it helps you do something to improve your situation, Dr. Bastin said.

How much complaining is good for you? How long is a piece of string? You want to avoid what Dr. Grice calls wearing “muddy glasses,” where no matter what’s going on you always find something to complain about. The same goes with rehashing a problem over and over again, whether with friends or in the echo chamber of the internet.

Ultimately, Dr. Bastin said, “emotional disclosure is important,” but “the way in which you disclose” is what determines whether the interaction has a positive or negative impact, not just on the complainer but also the person who is listening.

How to do it right

“Complaining is honestly just part of the social fabric of our lives, it’s part of how we communicate,” Dr. Kowalski said. As in every type of communication, there’s an appropriate place and time.

Start by paying attention to how often you complain, and who you’re doing it with. “You can’t modify behavior until you become aware of it,” Dr. Kowalski said.

While trying to go cold turkey is probably an overambitious goal, “mindfulness has been shown to be very effective in decreasing rumination,” Dr. Bastin said. Even just the act of paying attention to our habits can start shifting them. If you take a breath before calling a friend to vent, or reflect quickly on if you really need to act on your impulse to complain, you’ll be more mindful of your behavior and be able to make choices accordingly.

“It’s crucial, if you’re venting, to know that you’re venting and to tell the person you’re venting,” Ms. Gilbertson said. Whether you just want to blow off steam or actually need help solving a problem, clarifying what you want from the interaction will make the receiver of your venting more comfortable, and it will better prepare them to give you the support you need.