Why must object classes be serialized in java and java object classes be serialized?

Source: Internet
Author: User

Why must object classes be serialized in java and java object classes be serialized?
When the client accesses a resource that can enable the session function, the web server creates an HTTPSession object, and each HTTPSession object occupies a certain amount of memory. If too many users are accessed in the same time period, this will consume a lot of server memory. To solve this problem, we use a technology:Session persistence.What is session persistence?The web server will transfer the temporarily inactive and non-invalid HTTPSession objects to the file system or database for storage. When the server wants to reload them to the memory. Serialization is required when transferring Session objects to the file system or database for storage;Java. Io. Serializable.Perform a passivation operation when tomcat is restarted, and then activate it after it is started successfully. It is loaded in the corresponding region and will not be lost (the premise is that the variables stored in the session must implement the serialization interface to be deactivated before they can be serialized to a binary file on the hard disk ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.