When does the php static method start to occupy the memory? Will different php processes share static methods?

Source: Internet
Author: User
When does the php static method start to occupy the memory? For example, I have considered the following situations for a class {code...}: when executing php code, I will scan static methods. whether there is any include., it should not be used if the efficiency is too low. When I include & #039; Test. php & #039;, when will the static method of... php start to occupy the memory? For example, a class
Class Test {public static function test1 () {} public static function test2 (){}...}
I have considered the following situations:
  1. When executing php code, scan static methods, whether or not include., Should not be used if the efficiency is too low.

  2. In myInclude 'test. php'Will it scan the class and load the static method into the memory. At this time, all methods should be loaded into the memory.

  3. Assume that2If not, is the method called?Test: test1 ();When loading the data into the memory, will it load only the current method or all the static methods of the current class at this time?

Will different php processes share static methods? For example

Here there is a great God said Nginx and Php-fpm processes and threads: https://segmentfault.com/q/10...

If so, a Php-fpm process serves a client. but if the concurrency is too high, won't there be many processes? According to process communication, requests from different clients belong to different processes and should not affect each other. There should be a static method cache in the memory occupied by the process, however, if a client has multiple requests and read the article as a blocking single-threaded model, each request should be executed only after the previous request is completed, will the static method cache be clear at this time, or will it be saved? If it is cleared, the static method will not be shared.

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.