# Server pegging CPU every day, requiring restart

**URL:** <https://forum.servoy.com/t/server-pegging-cpu-every-day-requiring-restart/15596>\
**Category:** Classic Servoy\
**Created:** [February 29, 2012, 9:29pm UTC](https://forum.servoy.com/t/server-pegging-cpu-every-day-requiring-restart/15596 "2012-02-29T21:29:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanparrish](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@ryanparrish](https://forum.servoy.com/u/ryanparrish)\
**Post date:** [February 29, 2012, 9:29pm UTC](https://forum.servoy.com/t/server-pegging-cpu-every-day-requiring-restart/15596/1 "2012-02-29T21:29:08Z")

</div>

We are having an issue where about once every day or day & a half, the servoy server process will peg the server CPU until we relent and restart the server, sometimes after 15min of trying to find the issue. During this time smart clients will be unresponsive, the servoy-admin page will slow to a crawl and the web clients will start to timeout. I’ve attached the dump from the admin page, if someone can make some sense of what the issue may be I would (and our customers) appreciate it. I also attached a dump from right after the restart so you can see its ‘clean’ state.

[restart.txt](https://forum.servoy.com/uploads/short-url/r683SUFWw42is1izUqqbYB1R5K.txt) (64.1 KB)

[frozen.txt](https://forum.servoy.com/uploads/short-url/7wynQqpoicVTOHQSu5znCWBgPEM.txt) (180 KB)

---

<div class="post-metadata">

**Author:** ![chico](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@chico](https://forum.servoy.com/u/chico)\
**Post date:** [March 1, 2012, 3:29am UTC](https://forum.servoy.com/t/server-pegging-cpu-every-day-requiring-restart/15596/2 "2012-03-01T03:29:26Z")

</div>

We were having a similar problem and learned that it was a databaseManager.recalculate(foundsetofsomesort) which was the culprit.

When we removed it, the problem went away. We’d really notice the slowdown as the number of clients connected picked up.

This might be obvious, but it wasn’t to us at the time.

FYI, I have not looked at your stack dumps as I’d have no idea what they would mean. ![:P]( "Razz")

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [March 1, 2012, 1:30pm UTC](https://forum.servoy.com/t/server-pegging-cpu-every-day-requiring-restart/15596/3 "2012-03-01T13:30:28Z")

</div>

> chico:  
> We were having a similar problem and learned that it was a databaseManager.recalculate(foundsetofsomesort) which was the culprit.

Or perhaps not reading the docs is the culprit? ![;-)]( "Wink")

[http://wiki.servoy.com/display/public/D … ecalculate](http://wiki.servoy.com/display/public/DOCS/Database+Manager#DatabaseManager-recalculate)

from the docs/sample code: " please use with care, this can be expensive!"

---

<div class="post-metadata">

**Author:** ![chico](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@chico](https://forum.servoy.com/u/chico)\
**Post date:** [March 1, 2012, 2:02pm UTC](https://forum.servoy.com/t/server-pegging-cpu-every-day-requiring-restart/15596/4 "2012-03-01T14:02:05Z")

</div>

Jan, I would agree that we were the culprit, which is the case most of the time ![:)]( "Smile") But see our SSL post, we’re stumped there:

[viewtopic.php?f=5&t=17828](https://www.servoy.com/forum/viewtopic.php?f=5&t=17828)

---

<div class="post-metadata">

**Author:** ![ryanparrish](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@ryanparrish](https://forum.servoy.com/u/ryanparrish)\
**Post date:** [March 1, 2012, 3:51pm UTC](https://forum.servoy.com/t/server-pegging-cpu-every-day-requiring-restart/15596/5 "2012-03-01T15:51:40Z")

</div>

We most certainly use a sprinkling of .recalculate() throughout our solutions, and try to be conservative with its usage. I did foolishly forget to mention that we where previously on servoy 5.2.8 in production and these issues arose when we moved production to 5.2.12 (development had been on 5.2.11/12 for a while). Of course their had also been code changes in the development cycle when we went to 5.2.12, so, that doesn’t really nail down anything.

---

<div class="post-metadata">

**Author:** ![dpearce](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpearce](https://forum.servoy.com/u/dpearce)\
**Post date:** [March 7, 2012, 7:50am UTC](https://forum.servoy.com/t/server-pegging-cpu-every-day-requiring-restart/15596/6 "2012-03-07T07:50:16Z")

</div>

I have had these issues with one solution, which have stayed since Servoy 3.5.

I am sure it is my fault, but tracking down the issue is very hard. I don’t use .recalculate, but find that the server CPU usage from servoy goes up and up and up until reboot of the server, which we have been doing every night in order to bring it back down.

However restarting Servoy sorts it out, so we now use CURL to do this curl -o result.html [http://xxxxxx:xxxxxxxxxxx@localhost:808 … dmin/?rf=1](http://xxxxxx:xxxxxxxxxxx@localhost:8080/servoy-admin/?rf=1)

rather than restarting the server.

The main culprits maybe undeclared global variables or memory leakage from a plugin, but I find the a daily restart of servoy keeps it under control.

I have no idea how to try and find the exact culprit though!

David
