★★★★★
Saliva is foamy because there are many air bubbles in it , and air bubbles are result of dehydration , when you're dehydrated your salivary glands can't make saliva properly, so because of lack of water there are much air bubbles in it ..
Your body produce saliva to help digesting the food, when your stomach can't digest the food, body produce saliva ( ofcourse it is not the only reason of saliva excretion , but this is one of many ) to help your upset stomach ..
My history:
I'm suffering from esophagitis caused by gerd and duodenitis .. Even drinking water itself made me feel bloated ..
How I stopped saliva production:
As I even wasn't able to drink water without getting sick , I used to put a glass of water beside me, and sipping on it every once in awhile , specially right after I felt bloated or burp painfully, just after some days I got better, no more foamy saliva in my mouth and saliva production completely went away and I never felt bloated that bad again, and everytime felt a bit bloated, just sipped on water and everything came back to normal so fast cause now I know what my body is trying to tell me ..
Hope it helps somebody cause this situation really hurts and interferes with life activities ..