Unlike regular computer, server computer runs 24 hours a day.
In detail, it runs until shutdown, not 24 hours a day
In this case, memory is stacked in server
For example,
Even if user who has accessed my web site leaves my web site,
the object used by accessed user was still remain
so memory is stacked
java's garbage collector removes object that considerd to be less likely to usable
In other words, objects that have not been removed are considerd to be usabled
When a lot of objects are accumulated like this, memory is accumulated on the server because the object must be managed by memory.
In this case, memory is initialized by reboot the server
I'll explain why memory was initialized by comparing it to a real computer use case
If you reboot the computer with the game running, the computer will start up with the game closed.
Likewise, If you reboot the server, object was removed and so memory is initialized
But if you use this way for manage server, it is not recommended
because rebooting the server causes inconvenience to users
For cloud environment, you can use two server
so if one breaks down by memory error, you can concentrate traffic to another server
and replace the break down server with a new one
This way, you can continue to operate normally without the server going down.
Comments
Post a Comment