Intermittent freezing

I’m sure this is a perfectly simple problem, but its got us stumped. We have written an OpenGL application which runs on Redhat V7. We have postgres running in the background, as much of the application is database oriented, though we have killed off all other unncessary processes.

The problem we have is that intermittently, the OpenGL user interface appears to freeze. This happesn after it has been idle for some time (usually hours, rather than minutes). The observed behavious is that events seem to take a very much longer time to process than usual. After a couple of minutes, everything returns to normal.

We have been using top to see if anything we are unaware of is kicking in, and slowing things down, but we have seen nothing that would explain this.

Any of you bright people out there have any idea?