I think you need to find out what happens on clicking submit/sign-in because I doubt the jvm should run out of memory while doing this. Maybe it goes in some kind of an infinite loop and keeps downloading data? Maybe Google's sign-in recognizes when a non browser tries logging in?