TMZ/Getty Composite

Kroy Biermann Kim's Got Gambling Problem ... She Needs Psych Exam!!!

Kroy Biermann says his estranged wife, Kim Zolciak, spends so much time gambling their money away online, she can't take care of their kids ... and now he's asking the judge to order a mental evaluation for her.

According to new legal docs, obtained by TMZ, Kroy says Kim's been showing some "very troubling behavior" that's accelerated in the months leading up to their divorce.

Kroy claims Kim has admitted to him that she's spending a lot of time and money on online gambling and other games of chance, and he claims her "compulsion" has devastated the family financially.

What's more, Kroy claims Kim is so consumed with online gambling she's unable to properly care for the couple's four minor children ... and as a result, he says he's concerned for the kiddos' safety and well-being.

Kroy says it's in the best interest of their kids for Kim to sit for a psych exam ... he suspects her alleged gambling problem may be the result of underlying mental health issues like depression, anxiety, narcissistic personality disorder, bipolar disorder or ADHD.

TMZ broke the story ... Kim and Kroy are deep in the hole, owing more than $1 million to the IRS.

The divorce is getting uglier by the day ... Kroy's legal papers come on the heels of Kim asking a judge to step in and force Kroy to get a drug test.

As we first reported ... both Kim and Kroy filed separate divorce petitions earlier this month, and they are both seeking custody of the kids ... and the recent filings indicate things are getting nasty.

Kim and Kroy are still living under the same roof with their kids, in the same Georgia estate that went into foreclosure earlier this year ... so it's a safe bet tensions between the two are running high.

Click here for info about our online advertising practices.