dcsimg
Sending objects on remote computer causes JVM memory full
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ina_Shivdasani
Posted On:   Sunday, November 16, 2008 12:22 PM

I need to capture the screenshot of any remote computer and send it on other side.Now i am using ObjectOutputStream to do this.Temporily the purpose is solved it sends the object for approximately 5 to 6 times on other side and then exception occurs.The Exception is: java.lang.OutOfMemoryError: java heap space please help me to overcome the problem as i need to send objects continously to provide a feel of a real vedio desktop capturing.. On client side ois=new ObjectInputStream(s.getInputStream()); while(true) { try { img=(ImageIcon)ois.readObject(); lblImage.setIcon(img); setVisible(true); } catch(Exception e) { e.print   More>>

I need to capture the screenshot of any remote computer and send it on other side.Now i am using ObjectOutputStream to do this.Temporily the purpose is solved it sends the object for approximately 5 to 6 times on other side and then exception occurs.The Exception is: java.lang.OutOfMemoryError: java heap space

please help me to overcome the problem as i need to send objects continously to provide a feel of a real vedio desktop capturing..

On client side

			
ois=new ObjectInputStream(s.getInputStream());
while(true)
{
try
{
img=(ImageIcon)ois.readObject();
lblImage.setIcon(img);
setVisible(true);
}
catch(Exception e)
{
e.printStackTrace();
}
}//en dof while

On server side

			
while(true)
{
try
{
image = robot.createScreenCapture(screenRect);
ImageIO.write(image, "jpg", new File(outFileName));
ImageIcon img=new ImageIcon("out1.jpg");
oos.writeObject(img);
}
catch(Exception e)
{
e.printStackTrace();
} }
   <<Less
About | Sitemap | Contact