A peritoneal dialysis (PD) system for infusing a volume of PD solution into a patient's peritoneal cavity in order to perform peritoneal dialysis on the patient includes a peritoneal cavity monitor (PCM) that measures this volume of fluid in the patient's peritoneal cavity by segmental bioimpedance spectroscopy (SBIS), to thereby determine an ultrafiltration volume of fluid in the patient's peritoneal cavity, and a switch, controlled by the PCM, for filling the patient's peritoneal cavity and draining the patient's peritoneal cavity when the ultrafiltration volume is unchanged over time, significantly decreased, or decreasing at a significant rate.