Is there a command you can use in linux to check for SQL statements that have not been closed off or went off into never never land? Also, is there a way to free up those resources through a command?
Linux has nothing to do with SQL...
You should check the manual for whatever database you're using.
If it's MySQL, I reccomend you Google search mysql.com and examine the MySQL log files.