Home arrow static arrow Java Programming [Archive] - How do you reset memory buffer?
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - How do you reset memory buffer?
This topic has 5 replies on 1 page.

Posts:343
Registered: 7/13/04
How do you reset memory buffer?  
Jul 27, 2004 2:34 PM



 
My program performs 20,000 loops currently, storing information in a database. it goes through about 7,000 loops within a minute, but once it reaches 7,500 loops it slows down to about one loop every 4 seconds. I think the reason for this (from everything i've read on the internet) is there is X amount of buffer space:
---------------------------------------


and it fills it all up as it runs

XXXXXXXXXXXXXXXXXXXXXB


then it has to knock off the last piece of information (represented by the B) to make more room

--XXXXXXXXXXXXXXXXXXXXX


now it has room again. what i want to do is once it's filled, erase the whole thing and start over.
(is this possible? (or am i just totally wrong on how memory is used up))
 

Posts:6,750
Registered: 1/25/04
Re: How do you reset memory buffer?  
Jul 27, 2004 2:54 PM (reply 1 of 5)



 
Can you describe what the loop does? If it's small enough you could post it using code tags.
 

Posts:37,103
Registered: 3/30/99
Re: How do you reset memory buffer?  
Jul 27, 2004 3:00 PM (reply 2 of 5)



 
Yes, and please explain which buffer you're talking about. If you're writing to a database, there are undoubtedly several buffers involved.
 

Posts:3,055
Registered: 18/06/98
Re: How do you reset memory buffer?  
Jul 27, 2004 3:03 PM (reply 3 of 5)



 
Murderess,

If you suspect that your problem is memory-related, run your program and use some memory visualization tool like visualgc (search it in java.sun.com site).
Probably you're forgetting to close something.
 

Posts:343
Registered: 7/13/04
Re: How do you reset memory buffer?  
Jul 27, 2004 3:17 PM (reply 4 of 5)



 
i wasn't refering to any buffer specifically the streams i use are:

in = new DataInputStream(new BufferedInputStream(new FileInputStream("c:/test2.txt")));
sql = new Access("MDARS");
// which draws from:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
dbConn = java.sql.DriverManager.getConnection("jdbc:odbc:" + name);
 

Posts:343
Registered: 7/13/04
Re: How do you reset memory buffer?  
Jul 27, 2004 3:24 PM (reply 5 of 5)



 
Probably you're forgetting to close something.

thats the problem, i didn't close the "Statement"

thnak you
 
This topic has 5 replies on 1 page.