Hi all ,
I am new to this . This is my first post . I really need some help from you all members of this forum.
My situation is something like this .
I am communicating with 2 system .Both the systems are in LAN . In the first system (Windows xp) my java application and database (MYSQL 5.0) is running.
My second system is my linux machine which has an applcation running which sends some xyz information for every packet which it receive to my java application.It is configurable for example if I give tcp packets then it will send information only when TCP packet is recived .Similarly If I give ICMP packets then it will send information only when ICMP packet is recived ... .
What i am doing is i am reading the information from the socket and inserting into some table in the database. Some time when the traffic over network is high I am getting around 10000 messages per second.
So what i m doing is i am adding the message as an string object to a vector. And i have a thread running which for every 2 seconds read that vector and perform a bulk insertion to the database with the values in that vector and then empty the vector.
This logic is working properly but sometimes when traffic is very high then I get runtime exception ie java out of memory exception.
How to solve this problem please can anyone help me out.
Thank you for your response