Application management method and apparatus
An application management method includes collecting a plurality of objects in an application instance used for serverless computing and generating a base tree according to a reference hierarchical relationship of the plurality of objects; performing internal memory object rearrangement on a plurality of application instances according to the base tree; and performing internal memory merging on the plurality of rearranged application instances.
1 . An application management method, comprising:
collecting a plurality of objects in an application instance used for serverless computing;
generating a base tree according to a reference hierarchical relationship of the plurality of objects;
performing internal memory object rearrangement on a plurality of application instances according to the base tree, wherein:
the plurality of application instances comprise one application instance in which the plurality of objects are collected and the base tree is generated and a plurality of other application instances similar to the application instance, and
performing internal memory object rearrangement on the plurality of application instances according to the base tree comprises rearranging data in an internal memory corresponding to each application instance in the plurality of application instances according to the base tree; and
performing internal memory merging on the plurality of rearranged application instances.
2 . The method according to claim 1 , further comprising:
cold-starting the plurality of application instances;
performing an in-heap garbage recovery operation on the plurality of application instances; and
releasing a temporary object.
3 . The method according to claim 2 , wherein collecting the plurality of objects in the application instance and generating the base tree according to the reference hierarchical relationship of the plurality of objects comprise:
collecting a plurality of surviving objects in a heap after releasing the temporary object, and generating the base tree according to a reference hierarchical relationship of the plurality of surviving objects.
4 . The method according to claim 3 , wherein collecting the plurality of surviving objects in the heap after releasing the temporary objects, and generating the base tree according to the reference hierarchical relationship of the plurality of surviving objects, comprises:
collecting a plurality of top-layer objects surviving in the heap as a first layer of the base tree;
collecting plurality of objects that are directly referenced by objects of the first layer as a second layer of the base tree; and
repeating the collecting until obtaining a final layer.
5 . The method according to claim 4 , wherein the base tree comprises an address and a hierarchical relationship of an object; and
the base tree comprises object meta data of each class area of each layer.
6 . The method according to claim 1 , wherein performing internal memory merging on the plurality of rearranged application instances comprises:
performing internal memory labeling on a plurality of application instances subjected to the internal memory object rearrangement in a designated heap area; and
enabling kernel internal memory sharing to trigger internal memory sharing between the plurality of application instances.
7 . The method according to claim 1 , further comprising:
performing a class data sharing operation on a meta area of the plurality of application instances to perform internal memory sharing across the plurality of application instances.
8 . The method according to claim 1 , further comprising:
performing frame recovery on a thread of the plurality of application instances.
9 . The method according to claim 1 , further comprising:
instances various application instances of different applications as the plurality of application instances into an application group; and
performing the internal memory object rearrangement and the internal memory merging on the plurality of application instances in each group of a plurality of application groups.
10 . The method according to claim 1 , further comprising:
restoring a full flow receivable state of the plurality of application instances based on an expansion instruction.
11 . The method according to claim 10 , wherein the plurality of application instances are a plurality of application instances used for vertical expansion.
12 . The method according to claim 10 , further comprising:
snapshotting the plurality of application instances subjected to the internal memory merging into a snapshot; and
starting the plurality of application instances based on the snapshot to restore the plurality of application instances to the full flow receivable state of the plurality of application instances.
13 . The method according to claim 12 , further comprising:
distributing the snapshot across machines to achieve horizontal expansion of the plurality of application instances.
14 . An apparatus for application management, the apparatus comprising:
a memory configured to store instructions; and
one or more processors configured to execute the instructions to cause the apparatus to perform operations comprising:
collecting a plurality of objects in an application instance used for serverless computing and generating a base tree according to a reference hierarchical relationship of the plurality of objects;
performing internal memory object rearrangement on a plurality of application instances according to the base tree, wherein:
the plurality of application instances comprise one application instance in which the plurality of objects are collected and the base tree is generated and a plurality of other application instances similar to the application instance, and
performing internal memory object rearrangement on the plurality of application instances according to the base tree comprises: rearranging data in an internal memory corresponding to each application instance in the plurality of application instances according to the base tree; and
performing internal memory merging on the plurality of rearranged application instances.
15 . The apparatus according to claim 14 , wherein the operations further comprise:
cold-starting the plurality of application instances;
performing an in-heap garbage recovery operation on the plurality of application instances; and
releasing a temporary object.
16 . The apparatus according to claim 15 , wherein the operations further comprise:
collecting a plurality of surviving objects in a heap after releasing the temporary object, and generating the base tree according to a reference hierarchical relationship of the plurality of surviving objects.
17 . A non-transitory computer readable medium that stores a set of instructions that is executable by one or more processors of an apparatus to cause the apparatus to perform operations comprising:
collecting a plurality of objects in an application instance used for serverless computing and generating a base tree according to a reference hierarchical relationship of the plurality of objects;
performing internal memory object rearrangement on a plurality of application instances according to the base tree, wherein:
the plurality of application instances comprise one application instance in which the plurality of objects are collected and the base tree is generated and a plurality of other application instances similar to the application instance, and
performing internal memory object rearrangement on the plurality of application instances according to the base tree comprises: rearranging data in an internal memory corresponding to each application instance in the plurality of application instances according to the base tree; and
performing internal memory merging on the plurality of rearranged application instances.
18 . The non-transitory computer readable medium according to claim 17 , wherein the operations further comprise:
cold-starting the plurality of application instances;
performing an in-heap garbage recovery operation on the plurality of application instances; and
releasing a temporary object.
19 . The non-transitory computer readable medium according to claim 18 , wherein the operations further comprise:
collecting a plurality of surviving objects in a heap after releasing the temporary object, and generating the base tree according to a reference hierarchical relationship of the plurality of surviving objects.