Can I get the size of a chunk of my nav mesh?

My game uses dynamic walls that will sometimes trap my AI in a small section of an arena. Ideally I would like to be able to check to see how large the piece of the navmesh the AI is currently on is, so I could trigger a behavior to knock down walls if it becomes too small.

To be clear: I have a nav mesh component that cover the arena, and want to know how to get the size of a piece of it that is cut off from the rest by a wall.