Hello i use a servlet that contains a persistence manager object with two objects and when i use it in the dashboard i have this message:
"This URI uses a hight amount of cpu and may soon exceed its quota."
I have 2300 for the avg Cpu for this uri, why it takes so long?
When i'm looking the log at the beginning i have a hight amount of cpu for example 2000 and after i have less than 200 why ?
And 10 min later when i come back i have a hight amount of cpu again why?
It could be possible to reduce this time ?
Edit : code
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
String param1 = req.getParameter("param1");
String param2 = req.getParameter("param2");
PersistenceManager pm = PMF.get().getPersistenceManager();
String query = "select from " + Myclass.class.getName()+
"where parameter1 == param1 && parameter2 == param2 "+
"parameters String param1, String param2";
List<Myclass> result = (List<Myclass>) pm.newQuery(query).execute(param1, param2);
if(result.isEmpty()) {
pm.close();
resp.sendRedirect("/welcome.jsp");
}
else {
pm.close();
resp.sendRedirect("/question.jsp");
}
}