• Post Reply Bookmark Topic Watch Topic
  • New Topic

java out of memory exception

 
Sam Wells
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,
I am new to this . This is my first post . I really need some help from you all memebers 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
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess this is the wrong forum to ask this question.


Is it the Vector that grows in size so the system runs out of memory? Can you flush data to disc and let another thread read from disk and make bulk insert? I really think you should ask this quesion in performance, the IO or the java middle forum.

// Mathias
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!