curtis harrison

Greenhorn
+ Follow
since Sep 12, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by curtis harrison

In the following code snip, I'm closing the prepared statement, yet it seems like the database is still caching a copy of the statement.
I ran this several thousand times on a machine, connected through our internal network to a database on a different machine with nothing connected to the database except for my java program. I observed free memory gradually decreasing on the database machine (using the unix 'top' function). When I ended my java process that was running the code below, the database became VERY busy for several minutes. The CPU was at about 0% idle time. The database was cleaning out a bunch of prepared statements (all the same statement content as below).
Do I need to explicitly 'free' the prepared statement?
How do I do this?
Do I need to force some garbage collection every so often to clear the prepared statements from the databases cache?
Here's the code snip:
void myMethod()
{
String sql = "insert into stress_output "+
"(iteration, start_date)"+
" values (?,?)";
PreparedStatement ps = pConn.prepareStatement(sql);

ps.clearParameters();
ps.setInt(1, myInt);
ps.setLong(2, myLong);
ps.execute();
ps.close();
}
Oops...
THANKS ROY..
When I had first read it, I took totalMemory() to mean system memory, not process memory...
Thanks all
22 years ago
Ok guys,
I found my own answer... Using the following code, you can get the current memory being used by you java process:
//initialize it once, it keeps up to date..
Runtime runtime = Runtime.getRuntime();

//then call this whenever you want to know the
//current memory used by your process...
System.out.println(runtime.totalMemory());

See ya,
Curtis
22 years ago
That may be skewed by other processes running on the system. Is there any way to see exactly how much of the system memory my particular process is using?
22 years ago
Good morning,
I want to monitor how much memory my java process is using at any given time. Is there a way, within a java process, to determine how much memory is being used by that process?
I could use Windows Task Manager, but we want to start several processes on several boxes and have each process monitor itself.
Is this possible? The main item of interest is how much memory my current process is using.
Thanks,
Curtis
22 years ago
I have a JSP page (page1) with a dynamic <select> list. When the user first gets to the page, nothing is selected. They select an item, click a button, and the correct item is sent to the next page (page2). However, from page 2, if the user presses the browser's back button, they go back to page 1, the same list is displayed with their previous selection highlighted. When they change the selection and click the 'next' button, they go to page 2, but the FIRST selection they had made is sent to page 2, not the most recent selection.
If they press the browser's back button and see the list with a selected item, and then press the browser's refresh button, the selection in the list is unselected. They can make a new selection, press the 'next' button, and the CORRECT item appears.
Is there a way for me to force a 'refresh' when a page 1 loads, or FORCE some kind of 'unselect' on the selection list when the page is revisited. I don't EVER want an item to be initally selected in the selection list.
Is there a command to 'unselect' all items in the list?
Thanks,
Curtis
22 years ago
Ok,
Again, I'm new to this stuff... What's a servlet? How do you implement it? Pretend I'm REALLY new. Spoonfeeding is appreciated.
Could you give me an example of EXACTLY how to use the sendRedirect() statement works? (ie: Arguements? Where I get the HTTP Path, if needed...)
Thanks,
Curtis
22 years ago
Ok, I'm new to this jsp stuff. I have a page (Page1) that uses another page (Page2) to submit some data to a database. When Page2 is done processing, I want the browser to navigate back to Page1.
I tried using the following, but the text in the 'Address' box at the top of my browser is reflecting the URL for Page2...
<jsp:forward page="Page1.jsp" />

Is there just a quick and easy way to fix this?
22 years ago