For those whose PKM is defending in a gym, don't be stingy in giving berries to other defenders on your team. The current meta is such that as soon as one of the defenders is down, the whole gym structure is weakened. If you want your pkm to stay a bit longer, keep the other defenders full as well if you have enough berries.