In my Task Manager i found that Mysqld.exe takes till 130kb of RAM size and once it reaches this size my application size(javaw.exe) in RAM is gradually increasing which causes the system to hang. Why this takes place? Anyone Please Help. My application is written in java. becaus of this my application is running very slowly
これは私が接続した方法です。このスレッドは毎秒呼び出されます。mysqld.exeと私のアプリケーションでRAMサイズが増加します
thread_sample_s1 = new Thread(new Runnable() {
public void run() {
try {
ResultSet ress1 = null;
Statement state_men = null;
Connection conn_sample_s1 = null;
try {
conn_sample_s1= (Connection)DriverManager.getConnection(url_s1+db_s1,user_s1,pwd_s1);
} catch (SQLException e3) {
// TODO Auto-generated catch block e3.printStackTrace();
}
conn_sample_s1.setAutoCommit(false);
state_men = conn_sample_s1.createStatement();
//--->> Queries
state_men.close();
ress1.close();
conn_sample_s1.commit();
conn_sample_s1.close();
} catch (SQLException e) {
e.printStackTrace();
}
} }); thread_sample_s1.start();
これ以上のスレッドがあります。 1秒ごとに新たに起動されます
DB接続の使い方を示すサンプルコードを投稿しない限り、誰もランダムに推測する以上のことはできません。これは時間の無駄です。 – MarsAtomic
どのくらいのRAMがありますか? my.cnfのデフォルト値を変更しましたか? Javaのメモリにはどのような制限がありますか? –
2Gb RAMとjvmの512mb制限 –