tags:

views:

38

answers:

1

This might be related to another problem i am having. But in this case my app was idling and i had a crash in my GetConnection() on conn.open().

Since i was idling i figure it had comething to do with my queue in the background and possibly garbage collection? I took a look at netstat and found 16 connections.

Does mysql only accept 16 connections by default? is it because i am opening too many connections? this IS because of not closing/disposing connections? might commands have something to do with it or is that completely not the problem and is a MySqlConnection issue?

  TCP    127.0.0.1:7919          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:7920          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:7921          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:7922          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:7923          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:7924          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:7926          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:8782          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:8783          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:8784          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:8785          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:8786          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:8787          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:8788          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:8791          Adam-PC:3306          ESTABLISHED
  TCP    127.0.0.1:8792          Adam-PC:3306          ESTABLISHED
A: 

Are you disposing your connections? MySQL itself has connection pooling and the way to return connections to the pool is by disposing them.

Garbage collection should not pose a problem if you are correctly disposing your connections after you've used them.

Pieter
Interesting. I was wondering why when i close my app i still have so many questions. I am going to pretend it is a dispose problem and nothing else is causing this problem
acidzombie24
You should really try to hunt down any non-disposed connections. This will most likely solve your problems.
Pieter
I hunted down all of them. There were two areas without the using keyword outside of the class that does it in dispose(). But the errors still happen. Its pretty annoying because this crashes causing me to manually ctrl alt del the webdev process (for asp.net) every 10mins. I wonder if dispose is called when an exception is thrown. Maybe i forgot using on my main class and thats the problem? //talking to others or yourself in a comment helps
acidzombie24
Everything is dispose of except i have 5 members not having the using() keyword but thats because the object is passed into a thread that lives forever. So that is only being created once so... i dont get it... Even between stop/starts it should either not create it bc it exist or kill it on stop so... wtf... This isnt the problem? This is annoying.
acidzombie24
Yes, dispose is called when an exception happens. Concerning the threads: how many threads are there running after 10 minutes?
Pieter
The same amount. I only do it on app init. No where else. There might be additional classes but they are dispose of.
acidzombie24