Interface display method and electronic equipment

By increasing the GC waterline value of the GC thread during sliding operation, the problem of screen stuttering during sliding is solved, and a smoother interface display effect is achieved.

CN120255986APending Publication Date: 2025-07-04HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311808634.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-25
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

Users often experience screen stuttering when sliding the application interface of electronic devices, which affects the user experience.

Method used

By increasing the GC waterline value of the garbage collection GC thread when a sliding operation is detected, it avoids the main thread blocking caused by GC thread work, and improves the display effect during the sliding process.

Benefits of technology

It effectively avoids screen stuttering caused by GC thread blockage during sliding, and improves the display fluency and user experience of the user interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120255986A_ABST
    Figure CN120255986A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an interface display method and electronic equipment, in the method, the electronic equipment displays a first application interface of a first application; the electronic equipment displays a plurality of second application interfaces of the first application in response to a sliding operation acting on the first application interface; when the electronic device detects a sliding operation, a GC waterline of a garbage collection GC thread corresponding to the first application is lifted from a first waterline value to a second waterline value, and the first waterline value is the current waterline value of the GC waterline. According to the method, the situation that the image is stuck in the process that the electronic equipment displays the application interface in response to the sliding operation can be avoided, and the display effect of the application interface in the sliding process can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of terminals, and in particular, to an interface display method and an electronic device. Background Art

[0002] With the continuous development of terminal technology, the performance of electronic devices such as mobile phones and computers has been greatly improved, and users' requirements for the performance of electronic devices are also getting higher and higher. Among them, when a user performs an up and down sliding operation on the image displayed on an electronic device, the display coherence of the image in the sliding state is a performance of the electronic device that users are very concerned about.

[0003] Currently, when a user performs an up and down sliding operation on the application interface displayed on an electronic device, the application interface displayed by the electronic device in the sliding state will experience frame stuttering, which affects the user experience. Summary of the Invention

[0004] This application provides an interface display method and an electronic device, which can avoid frame stuttering during the process of the electronic device responding to a sliding operation to display an application interface, and can improve the user experience.

[0005] In a first aspect, this application provides an interface display method, which is applied to an electronic device. The method includes: the electronic device displays a first application interface of a first application; the electronic device responds to a sliding operation on the first application interface and displays multiple second application interfaces of the first application; when the electronic device detects the sliding operation, it raises the GC waterline of the garbage collection (GC) thread corresponding to the first application from a first waterline value to a second waterline value, where the first waterline value is the current waterline value of the GC waterline.

[0006] In the embodiments of this application, the electronic device can raise the waterline value of the GC thread corresponding to the first application when it detects a sliding operation on the first application interface. By raising the GC waterline of the GC thread, this method can avoid the main thread of the first application being blocked by the work of the GC thread, resulting in frame stuttering when the electronic device displays the application interface of the first application during the sliding process, and improve the display effect during the sliding process.

[0007] In combination with the first aspect, in a possible implementation manner, raising the GC waterline of the garbage collection (GC) thread corresponding to the first application from a first waterline value to a second waterline value includes: the electronic device determines the working state of the GC thread in response to the sliding operation; when the electronic device determines that the GC thread is in a non-working state, it raises the GC waterline from the first waterline value to the second waterline value.

[0008] In combination with the first aspect, in a possible implementation manner, raising the GC waterline of the garbage collection (GC) thread corresponding to the first application from the first waterline value to the second waterline value includes: when the electronic device determines that the sum of the free memory and the memory to be allocated corresponding to the first application is greater than the preset memory and the previous sliding process is completed, raising the GC waterline from the first waterline value to the second waterline value, where the preset memory is not less than the memory required for the electronic device to raise the GC waterline.

[0009] In combination with the first aspect, in a possible implementation manner, raising the GC waterline from the first waterline value to the second waterline value includes: when the electronic device determines that the free memory corresponding to the first application has increased to the preset memory and the difference between the heap memory corresponding to the first application and the limit value of the heap memory corresponding to the first application is greater than the preset value, raising the GC waterline from the first waterline value to the second waterline value; the heap memory corresponding to the first application includes the sum of the free memory and the occupied memory corresponding to the first application.

[0010] In combination with the first aspect, in a possible implementation manner, before raising the GC waterline of the garbage collection (GC) thread corresponding to the first application from the first waterline value to the second waterline value, the method further includes: the electronic device stores the current heap memory corresponding to the first application to obtain the first memory value; the electronic device raises the heap memory of the first application from the first memory value to the second memory value; raising the GC waterline of the garbage collection (GC) thread corresponding to the first application from the first waterline value to the second waterline value includes: the electronic device raises the GC waterline to the second waterline value based on the second memory value.

[0011] In combination with the first aspect, in a possible implementation manner, the method further includes: the electronic device, in response to a sliding operation, displays a third application interface after displaying a plurality of second application interfaces; if the GC thread is not working during the process of displaying the plurality of second application interfaces and the third application interface, the electronic device restores the GC waterline from the second waterline value to the first waterline value after displaying the third application interface.

[0012] In combination with the first aspect, in a possible implementation manner, restoring the GC waterline from the second waterline value to the first waterline value includes: the electronic device restores the heap memory of the first application from the second memory value to the first memory value; the electronic device restores the GC waterline from the second waterline value to the first waterline value based on the first memory value.

[0013] In combination with the first aspect, in a possible implementation manner, before raising the GC waterline of the garbage collection (GC) thread corresponding to the first application from the first waterline value to the second waterline value, the method further includes: the electronic device stores the number of working times of the GC thread to obtain the first number; if the number of working times of the GC thread is the first number after the electronic device displays the third application interface, the electronic device determines that the GC thread is not working during the process of displaying the plurality of second application interfaces and the third application interface.

[0014] In combination with the first aspect, in a possible implementation, an electronic device displays a first application interface of a first application, including: the electronic device displays an application window of the first application, and the application window includes a sliding area; the electronic device displays the first application interface in the application window; in response to a sliding operation on the first application interface, the electronic device displays multiple second application interfaces of the first application, including: in response to a sliding operation on the sliding area, the electronic device displays multiple second application interfaces of the first application in the window interface.

[0015] In combination with the first aspect, in a possible implementation, the method further includes: the sliding operation is used to indicate the interface update of the application window; the multiple second application interfaces of the first application are the application interfaces displayed during the interface update process of the application window. That the electronic device displays multiple second application interfaces of the first application in response to a sliding operation on the first application interface further includes: in response to a sliding operation on the sliding area, the electronic device displays a third application interface of the first application in the window interface, and the third application interface is the application interface displayed after the interface update of the application window.

[0016] In a second aspect, the present application provides an electronic device, which includes one or more processors and one or more memories; wherein, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the electronic device is caused to execute the method described in the first aspect and any possible implementation manner in the first aspect.

[0017] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the processors are used to call computer instructions to cause the electronic device to execute the method described in the first aspect and any possible implementation manner in the first aspect.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium, including instructions. When the above instructions run on an electronic device, the above electronic device is caused to execute the method described in the first aspect and any possible implementation manner in the first aspect.

[0019] In a fifth aspect, the present application provides a computer program product containing instructions. When the above computer program product runs on an electronic device, the above electronic device is caused to execute the method described in the first aspect and any possible implementation manner in the first aspect.

[0020] Understandably, the electronic device provided in the second aspect above, the chip system provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in this application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be elaborated here. Description of the Drawings

[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0022] Figure 1 It is a schematic structural diagram of a heap provided by an embodiment of this application;

[0023] Figure 2 It is a schematic diagram of a GC thread blocking the main thread provided by an embodiment of this application;

[0024] Figures 3A - 3D It is a schematic diagram of a set of scenarios where the application interface lags during the sliding process provided by an embodiment of this application;

[0025] Figure 4 It is a schematic diagram of a method for interface display provided by an embodiment of this application;

[0026] Figure 5 It is a schematic structural diagram of an electronic device 100 provided by an embodiment of this application;

[0027] Figure 6 It is a schematic software architecture diagram of an electronic device 100 provided by an embodiment of this application;

[0028] Figure 7 It is a schematic diagram of the overall process of an electronic device 100 performing GC management and control provided by an embodiment of this application;

[0029] Figure 8 It is a schematic diagram of the process of GC management and control provided by an embodiment of this application;

[0030] Figure 9 It is a schematic diagram of the process of a virtual machine executing to improve the GC waterline provided by an embodiment of this application;

[0031] Figure 10 It is a comparison diagram of the heap structure of the first application before and after the free memory increases to the preset memory provided by an embodiment of this application;

[0032] Figure 11This is a schematic diagram of the process for a virtual machine to execute and resume the GC waterline provided by an embodiment of the present application. Detailed implementation manners

[0033] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular forms "a", "an", "the", "above-mentioned", "said", and "this" are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more of the listed items.

[0034] The term "application interface" in the following embodiments of the present application is a media interface for interaction and information exchange between an application or an operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The application interface is source code written in a specific computer language such as Java, Extensible Markup Language (XML), etc. The interface source code is parsed and rendered on an electronic device and finally presented as content recognizable by the user. The common manifestation form of the application interface is a graphic user interface (GUI), which refers to an application interface related to computer operations displayed in a graphic manner. It can be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, etc. displayed on the display screen of an electronic device.

[0035] First, the terms related to the embodiments of the present application are described.

[0036] I. Garbage collection (GC)

[0037] Garbage collection is also called memory recycling, which refers to a memory recycling mechanism that reclaims isolated objects in the heap through a GC thread to release memory space. Among them, the GC thread is used to manage the objects in the heap, and can mark, organize, and delete isolated objects in the heap to release the memory occupied by those objects that are no longer used. The purpose of memory recycling is to clear objects that are no longer used, and by reclaiming the memory space occupied by useless objects, the memory space can be reused by the program.

[0038] Among them, the GC adopts an allocator and a collector. The allocator is responsible for obtaining more memory and triggering the collector at an appropriate time. The collector is responsible for reclaiming the object memory (referred to as garbage memory) that is no longer used by the program.

[0039] It should be understood that each process corresponds to a virtual machine, and each process contains a HeapTaskDaemon thread, which is mainly responsible for performing the function of garbage collection. Correspondingly, this thread can be called a GC thread. This GC thread is responsible for monitoring the usage of the virtual machine heap memory corresponding to this process, and determining whether to trigger GC according to the usage of the heap memory corresponding to this process.

[0040] II. Heap

[0041] The heap refers to the area in memory for storing objects (object instances). If the memory management technology uses the JAVA language, the heap is the largest area in the memory managed by the JAVA virtual machine. This area is a memory area shared by all threads. The heap is created when the JAVA virtual machine starts, and almost all objects are allocated memory in the heap.

[0042] Figure 1 FIG. Figure 1 exemplarily shows a schematic diagram of the structure of a heap. In the figure, the black area is exemplarily used to represent the occupied memory, the slanted area is used to represent the free memory, and the blank area is used to represent the memory to be allocated.

[0043] Among them, the heap memory limit value (growth_limit) represents the maximum memory that the current process (such as the first application) can allocate. That is to say, the heap memory (target_footprint) cannot exceed the heap memory limit value. Among them, the heap memory is the value of the memory allocated for the current process. The heap memory can include free memory and occupied memory. The occupied memory represents the value of the memory already occupied by the current process, and the free memory represents the value of the free memory of the current process. For the convenience of description, this application refers to the remaining allocable memory of the current process as the memory to be allocated. It can be understood that the sum of the memory to be allocated and the heap memory is less than or equal to the heap memory limit value.

[0044] Figure 1 The GC waterline is exemplarily shown. The GC waterline represents the threshold value that the current process needs to reach to trigger GC. When the occupied memory exceeds the GC waterline, the current process triggers GC to recycle the garbage memory. If the occupied memory exceeds the heap memory limit value, it will cause an out of memory (OOM), resulting in the crash of the current process. Among them, the difference between the heap memory and the GC waterline can be preset. For example, this difference can be 512KB.

[0045] Through research on data, the inventors of the present application found that when a user slides the application interface of an electronic device, the electronic device may probabilistically experience a situation where the GC thread of the application blocks the main thread (such as the UI thread) of the application, resulting in frame drops and lags in the application interface during the sliding process.

[0046] Figure 2 FIG. is a schematic diagram of a GC thread blocking the main thread exemplarily provided by an embodiment of the present application. Figure 2 Exemplarily shown are the main thread (also referred to as the first thread) of the first application and the HeapTaskDeamon thread. Among them, the first thread is used to process the display content during the sliding of the application interface of the first application; the slanted area is used to indicate that the main thread of the first application is in a working state, and the black area is used to indicate that the HeapTaskDeamon thread of the first application is in a working state.

[0047] During the period when the first thread of the first application is processing the display content during the sliding of the application interface of the first application, if the memory occupied by the first application exceeds the GC waterline, the electronic device starts the HeapTaskDeamon thread to recycle the garbage memory. At this time, the first thread stops working and waits for the HeapTaskDeamon thread to finish processing before continuing to work, resulting in lags in the display during the sliding of the application interface.

[0048] It should be understood that the first thread stops working because the electronic device prevents chaos in heap memory allocation, which may cause each thread to malfunction. Therefore, the electronic device will wait for the GC thread to finish processing before instructing other threads to work.

[0049] The following is an example of Figures 3A - 3D introducing the scenario of lags during the sliding of the application interface.

[0050] Figures 3A - 3D Exemplarily, the first application is taken as a search application for illustration. Figures 3A - 3D The application interfaces shown all include a sliding area 30. The sliding area 30 is used to detect sliding operations, and the sliding operations are used to indicate the update of the application interface of the first application.

[0051] Such as Figure 3A shown, the application interface 31 may include a search bar 311, information A and information B provided by the search application. When the electronic device detects an upward sliding operation on the sliding area 30, in response to the above sliding operation, a plurality of application interfaces (not shown in the figure) are displayed between 0 ms and 100 ms, and the application interface 32 shown in Figure 3B is displayed at 100 ms. It should be noted that the plurality of second application interfaces hereinafter may refer to a plurality of application interfaces displayed between 0 ms and 100 ms, and the third application interface may refer to such asFigure 3B The application interface 32 shown.

[0052] The application interface 32 may include a search bar 311, and search information A, information B, and information C provided by the search application. Subsequently, the electronic device continues to respond to the upward sliding operation. Between the 100th millisecond and the 300th millisecond, the heap memory of the search application exceeds the GC waterline, the virtual machine corresponding to this process instructs the GC thread to work, and the main thread of this process stops working. As Figure 3C shown, the electronic device shows no response to the upward sliding operation, that is, the electronic device lags during the sliding process. At the 300th millisecond, the GC thread finishes working, the main thread of this process continues to work, and the electronic device displays an application interface 33 as Figure 3D shown. The application interface 33 includes a search bar 311, and search information B and information C provided by the search application. Figure 3C Some or all of the multiple application interfaces displayed between the displayed application interface 32 and Figure 3D the displayed application interface 33 are lost (not shown in the figure). It should be understood that the content of information A, information B, and information C is not limited in the embodiments of the present application.

[0053] It should be noted that the sliding area 30 provided by the embodiments of the present application is an interactive area provided by the electronic device when a first application displays an application interface 31. The electronic device may determine the sliding area according to the application interface of the displayed first application. The embodiments of the present application do not limit the size and position of the sliding area on the application interface displayed by the electronic device.

[0054] It should be understood that the sliding process from the application interface 31 to the application interface 32 may include multiple application interfaces (not shown in the figure). If the first application triggers GC during the sliding process, it will cause one or more application interfaces displayed during the sliding process to be lost (i.e., frame drops occur), resulting in a phenomenon of picture lag (or called sliding lag), affecting the user experience.

[0055] In view of this, the embodiments of the present application provide an interface display method. When the electronic device receives a sliding operation on the first application interface of the first application, if the GC thread of the first application is in an inactive state, the GC waterline of the first application is increased. This method can reduce the probability of the first application triggering GC when the electronic device displays the application interface during the sliding operation in response to the sliding operation, thereby reducing picture lag and enhancing the user experience.

[0056] Next, the interface display method provided by the embodiments of the present application will be described in detail.

[0057] Figure 4 This is an interface display method provided by the embodiments of the present application.

[0058] Exemplarily, in the embodiments of this application, taking the application interface of the first application being swiped as an example, the process of the electronic device performing GC control during the swiping process is introduced.

[0059] Among them, the first application can be a system application or a third-party application. In the embodiments of this application, a system application refers to an application program directly provided by the operating system of the electronic device for implementing specific functions. A third-party application refers to an application program provided by other developers obtained by the electronic device through the Internet for implementing specific functions.

[0060] In the embodiments of this application, the swiping operation can be a touch operation of the user (such as a up-swipe operation, a down-swipe operation, or a side-swipe operation), or a non-contact operation (such as an air gesture), or a voice command of the user. The embodiments of this application do not make specific limitations on this.

[0061] S401: The electronic device displays the first application interface of the first application.

[0062] In some embodiments, the electronic device can display the application interface corresponding to the first application in the application window of the first application, such as the above-mentioned first application interface. Among them, the application window is a display window for displaying the application interface of the first application; this application does not limit the form (such as a floating window, etc.) and quantity of the application window.

[0063] Among them, the first application interface may include a swiping area, and the swiping area is an interactive area provided by the first application for the user. The user can perform a swiping operation in the swiping area to switch the application interface displayed in the application window of the first application.

[0064] Exemplarily, the first application interface displayed by the electronic device can be the application interface 31 as shown in Figure 3A . The application interface 31 can be a search interface corresponding to a search application. Among them, the application interface 31 includes a swiping area 30 and a search bar 311. The swiping area 30 is used to display search content and receive the swiping operation of the user to update the content displayed in the swiping area; Figure 3A It is exemplarily shown in that the content displayed in the swiping area is information A and information B.

[0065] It should be understood that the electronic device can display the size, quantity, and position of the swiping area in the application interface based on the application settings. The embodiments of this application do not limit the size, quantity, and position of the swiping area on the application interface displayed by the electronic device.

[0066] S402: The electronic device responds to the swiping operation acting on the first application interface and displays a plurality of second application interfaces.

[0067] Among them, the second application interface can be regarded as the application interface displayed by the electronic device in response to a sliding operation during the sliding process. The embodiments of the present application do not limit the number of second application interfaces displayed during the sliding process.

[0068] Exemplarily, the user can perform an upward sliding operation in the sliding area of the first application interface. When the electronic device detects the sliding operation acting on the sliding area, in response to the above sliding operation, a plurality of second application interfaces are displayed in the application window of the first application. The second application interface is the application interface displayed by the electronic device during the execution of the sliding operation. It should be understood that during the process of the electronic device displaying the application interface corresponding to the sliding operation, the memory occupied by the first application will increase, which may trigger the GC, resulting in a phenomenon of frame freezing in the displayed picture.

[0069] For example, the first application interface can be Figure 3A the application interface 31 shown in the figure. The electronic device can detect the sliding operation acting on the application interface 31 and, in response to the above sliding operation, display the corresponding application interface during the sliding process (such as the above-mentioned plurality of second application interfaces). The present application does not limit the execution duration of the sliding operation and the second application interfaces displayed during the execution of the sliding operation. It should be understood that during the sliding process, if the first application triggers the GC, one or more of the plurality of second application interfaces displayed therein may be lost (i.e., frame dropping), resulting in a phenomenon of frame freezing.

[0070] It should be noted that the present application does not limit the above-mentioned sliding operation acting on the first application interface displayed by the electronic device. Exemplarily, when the electronic device displays the first application interface of the first application, the user can also operate on the sliding area of the application window through an air gesture. Furthermore, the electronic device responds to the air gesture and displays a plurality of second application interfaces in the application window of the first application.

[0071] S403: The electronic device determines the sliding state of the first application in response to the sliding operation acting on the first application interface, where the sliding state of the first application may include a sliding start state and a sliding end state.

[0072] In some embodiments, in response to a sliding operation on a first application interface, an electronic device displays a plurality of second application interfaces. The electronic device may determine the sliding state of the first application when detecting the sliding operation (i.e., the start of the slide). Exemplarily, the electronic device may call a first function (such as the beginDetect() function) of the sliding detection module during the start of the slide to transmit information about the start state of the slide (such as a first state value, which is used to indicate that the current state is the start state of the slide) to the virtual machine corresponding to the first application. The electronic device may call a second function (such as the endDetect() function) of the sliding detection module at the end of the slide to transmit information about the end state of the slide (such as a second state value, which is used to indicate that the current state is the end state of the slide) to the virtual machine corresponding to the first application. If the information received by the virtual machine is the first state value, perform S405 below. If the information received by the virtual machine is the second state value, perform S407 below.

[0073] S404: In response to a sliding operation on the first application interface, after displaying the plurality of second application interfaces, the electronic device displays a third application interface.

[0074] Among them, the plurality of second application interfaces and the third application interface can both be regarded as the application interfaces displayed by the electronic device during the sliding process. Among them, the third application interface can be regarded as the last application interface displayed by the electronic device during the sliding process, that is, the application interface finally displayed by the electronic device at the end of the slide.

[0075] In some embodiments, when the sliding operation received by the electronic device ends, in response to the sliding operation, the electronic device displays the third application interface in the application window of the first application.

[0076] For example, the third application interface may be Figure 3A the displayed application interface 32. The electronic device may detect a sliding operation on the first application interface. In response to the above sliding operation, after displaying a plurality of second application interfaces, it displays the application interface 32. It should be understood that during the sliding process, if the first application triggers a GC, it may cause the loss of a plurality of second application interfaces displayed therein, resulting in a phenomenon of stuttering and frame dropping. That is, it may directly display the third application interface after displaying the first application interface.

[0077] S405: When the electronic device determines that the first application interface is in the start state of the slide, it determines the state of the GC thread of the first application, where the state of the GC thread includes a working state and a non-working state.

[0078] In some embodiments, when the electronic device determines that the first application interface is in the sliding start state, it may determine the state of the GC thread of the first application. When the electronic device determines that the GC thread is in the non-working state, the electronic device raises the GC waterline value of the first application from the first waterline value to the second waterline value. When the electronic device determines that the GC thread is in the working state, the electronic device does not adjust the GC waterline of the first application.

[0079] It should be understood that when the GC thread of the first application is working, the virtual machine does not adjust the GC waterline. If the GC waterline is adjusted during the working period of the GC thread, it may cause logical errors in the execution of the GC thread, thereby affecting the stability and reliability of the GC thread.

[0080] Wherein, the state of the GC thread being in the working state may mean that the GC thread is currently processing the recycling of garbage objects.

[0081] S406: When the electronic device determines that the GC thread is in the non-working state, it raises the value of the GC waterline of the first application from the first waterline value to the second waterline value.

[0082] Wherein, the first waterline value is the current waterline value of the GC waterline of the first application, and the first waterline value is less than the second waterline value.

[0083] Exemplarily, the first waterline value may be the initial value set by the electronic device for the GC thread.

[0084] In some embodiments, when the virtual machine corresponding to the first application of the electronic device determines that the electronic device is in the sliding start state, it may record the value of the current heap memory (target_footprint) (also referred to as the first memory value) and the number of times the first application triggers GC; based on the margin value (which may also be referred to as the newly added free memory), it raises the value of the heap memory to the second memory value. Wherein, the second memory value is the first memory value plus the margin value. Furthermore, the electronic device may determine the value of the raised GC waterline, that is, the second waterline value, according to the second memory value. It should be understood that the difference between the heap memory and the GC waterline may be a preset difference, so the electronic device can obtain the second waterline value based on the preset difference and the second memory value. Exemplarily, reference may be made to the relevant content below Figure 9 of the relevant content.

[0085] It should be understood that after the GC waterline of the first application is raised, the probability of the first application triggering GC during the sliding process is greatly reduced. Furthermore, the probability of the GC thread holding the lock and blocking the main thread and affecting the execution of the critical path of performance fluency during the working period is greatly reduced.

[0086] S407: When the electronic device determines that the first application interface is in the sliding end state, it determines the working state of the GC thread of the first application during the display of multiple second application interfaces and third application interfaces.

[0087] In some embodiments, when the electronic device determines that the first application interface is in the state of ending the sliding, it may determine the working state of the GC thread of the first application during the display process of the application interfaces corresponding to the sliding operation (i.e., multiple second application interfaces and third application interfaces); if the GC thread satisfies that it is not in the working state during the above display process and the current GC collector is not in the working state, it is determined that the GC thread is in the non-working state during the display process of the multiple second application interfaces and third application interfaces, and the following step S408 is executed: restore the GC waterline value of the first application from the first waterline value to the second waterline value; otherwise, it is determined that the GC thread is in the working state during the display process of the multiple second application interfaces and third application interfaces, and the electronic device does not adjust the GC waterline of the first application.

[0088] S408: When the electronic device determines that the GC thread is in the non-working state during the display process of the multiple second application interfaces and third application interfaces, the electronic device restores the value of the GC waterline of the first application from the second waterline value to the first waterline value.

[0089] In some embodiments, when the virtual machine corresponding to the first application of the electronic device determines that the electronic device is in the state of ending the sliding, it may determine whether the GC waterline of the first application is increased and whether the GC thread is not working during the sliding process. If so, the value of the GC waterline of the first application is restored from the second waterline value to the first waterline value. Exemplarily, refer to the relevant content below Figure 11 as follows.

[0090] Next, the form and software and hardware architecture of the electronic device provided in the embodiments of the present application are introduced.

[0091] Figure 5 The hardware structure of the electronic device in the embodiments of the present application is exemplarily shown.

[0092] Figure 5 It is a schematic structural diagram of an electronic device 100 provided in the embodiments of the present application.

[0093] As Figure 5As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0094] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0095] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0096] The controller may generate operation control signals according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions. A memory may also be provided in the processor 110 for storing instructions and data.

[0097] The wireless communication function of the electronic device 100 can be implemented by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor, baseband processor, etc.

[0098] The electronic device 100 implements the display function through the GPU, display screen 194, application processor, etc. In the embodiments of the present application, the electronic device 100 can implement the display Figures 3A - 3D of the application interface shown.

[0099] The electronic device 100 can implement the shooting function through the ISP, camera 193, video codec, GPU, display screen 194, application processor, etc.

[0100] The NPU is a neural-network (NN) computing processor. By drawing on the biological neural network structure, for example, drawing on the transmission mode between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, voice recognition, text understanding, etc.

[0101] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The RAM can be directly read and written by the processor 110, and can be used to store the operating system or executable programs of other running programs (such as machine instructions), and can also be used to store data of users and application programs, etc. The NVM can also store executable programs and store data of users and application programs, etc., and can be pre-loaded into the RAM for the processor 110 to directly read and write.

[0102] The external memory interface 120 can be used to connect to an external NVM to expand the storage capacity of the electronic device 100. The external NVM communicates with the processor 110 through the external memory interface 120 to implement the data storage function.

[0103] The electronic device 100 can implement the audio function through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor, etc. Such as music playback, recording, etc.

[0104] The pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. The barometric pressure sensor 180C is used to measure barometric pressure. The magnetic sensor 180D can be used to detect the magnetic adsorption state, such as the opening and closing of a flip cover or a flip leather case. The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The distance sensor 180F is used to measure distance. The proximity light sensor 180G can detect whether there is an object near the electronic device 100. The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect temperature.

[0105] The touch sensor 180K, also referred to as a "touch control device". The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 together form a touch screen, also referred to as a "touch control screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual outputs related to the touch operations can be provided through the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from the display screen 194. In the embodiments of the present application, the electronic device 100 can implement the detection of touch operations such as user clicking on the screen, long pressing, double clicking, dragging, etc. acting on the screen through the touch sensor 180K.

[0106] The bone conduction sensor 180M can obtain vibration signals. The keys 190 include a power-on key, a volume key, etc. The electronic device 100 can receive key inputs and generate key signal inputs related to the user settings and function controls of the electronic device 100.

[0107] The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts and can also be used for touch vibration feedback. The indicator 192 can be an indicator light. The SIM card interface 195 is used to connect a SIM card.

[0108] In the embodiments of the present application, the electronic device 100 can execute the interface display method provided in the present application through the processor 110. For example, the execution process may include: the electronic device 100 detects a sliding operation through the touch sensor 180K and displays the application interface corresponding to the sliding operation through the display screen 194 (such as the above-mentioned second application interface and third application interface and performing GC management and control through the processor 110, etc.

[0109] Figure 6Exemplarily shown is the software architecture of the electronic device according to the embodiments of the present application.

[0110] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. Taking the Android system with a layered architecture as an example in the embodiments of the present application, the software architecture of the electronic device 100 is exemplarily described.

[0111] Figure 6 It is a block diagram of the software architecture of an electronic device 100 provided by the embodiments of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime, the system libraries, and the kernel layer, etc.

[0112] The application layer may include a series of application packages. As Figure 6 shown, the application packages may include applications such as maps, voice assistants, cameras, music, etc., and the embodiments of the present application will not list them one by one.

[0113] In the present application, the first application may be any one of the above application packages, and the present application does not limit this; the first application may be a system application or a third-party application.

[0114] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0115] As Figure 6 shown, the application framework layer may include a sliding detection module, a window manager, a resource manager, a notification manager, a view system, etc.

[0116] Among them, the electronic device may call the functions in the sliding detection module during the sliding process of displaying multiple second application interfaces and third application interfaces. Exemplarily, the electronic device may call the first function of the sliding detection module at the start of the sliding and call the second function in the sliding detection module at the end of the sliding.

[0117] Android runtime includes core libraries and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system. The core libraries include two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android.

[0118] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform operations such as object lifecycle management, stack management, thread management, security and exception management, as well as garbage collection.

[0119] The system libraries can include multiple functional modules. For example: Surface Manager (surface manager or surfaceflinger), Media Libraries, 3D Graphics Processing Library (e.g., OpenGL ES), 2D Graphics Engine (e.g., SGL), etc.

[0120] The Surface Manager is used to manage the display subsystem and provides the fusion of 2D layers and 3D layers for multiple applications. The Media Libraries support the playback and recording of multiple common audio and video formats, as well as static image files, etc. The Media Libraries can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D Graphics Processing Library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D Graphics Engine is the drawing engine for 2D drawing.

[0121] The kernel layer is the layer between the hardware and the software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0122] Below the kernel layer can include the Physical Layer (physic, PHY). The Physical Layer can provide a transmission medium and an interconnection channel for data communication inside the device or between devices, and provide a reliable environment for data transmission. The Physical Layer can be understood as the transmission layer that provides "signals and media".

[0123] It can be understood that the above schematic diagram of the software structure hierarchical architecture is only exemplary. In other implementation manners, the software structure hierarchical architecture may also include other more or fewer layers, or a hierarchical structure formed in other ways. This application does not limit this.

[0124] Based on the above software and hardware architecture of the electronic device, the following Figures 7 to 11 illustrates the interface display methods provided by each embodiment of this application by delving into this architecture.

[0125] When the electronic device 100 responds to a sliding operation on the first application interface, the electronic device 100 can call a sliding detection module to detect the sliding state (sliding start state and sliding end state) of the first application interface. Exemplarily, when the sliding starts, the first function (for example, the beginDetect() function) in the sliding detection module starts to run. When the sliding ends, the second function (for example, the endDetect() function) in the sliding detection module starts to run, that is, the electronic device 100 can determine whether the first application interface is in the sliding start state or the sliding end state through the functions executed by the sliding detection module. Therefore, in the embodiments of the present application, the above two functions can be selected as the instrumentation points to determine the sliding state of the first application interface of the electronic device 100, so as to control the GC waterline of the first application.

[0126] Figure 7 FIG. is a schematic diagram of the overall process for an electronic device 100 to perform GC control provided by the embodiments of the present application.

[0127] In the embodiments of the present application, the software architecture of the electronic device 100 can be divided into a kernel layer, a system runtime library layer (Native), an application layer (App), and an application framework layer (Framework, FW); for ease of description, Figure 7 only Native, App, and FW are exemplarily shown.

[0128] As Figure 7 shown, the GC control can be specifically executed by the first application, the sliding detection module, and the virtual machine corresponding to the first application. Among them, the first application can be located in the App, the sliding management module can be located in the FW, and the virtual machine can be located in the Native. The electronic device 100 responds to a sliding operation on the first application interface and calls the sliding detection module to detect the sliding state of the first application interface. When the electronic device 100 detects that the first application interface is in the sliding start state, the first function (for example, the beginDetect() function) of the sliding detection module starts to run, and the sliding detection module sends a notification to increase the GC waterline to the Android Runtime (AndroidRuntime, ART), for example, specifically sends a notification to increase the GC waterline to the virtual machine corresponding to the first application in the ART. The virtual machine responds to the notification to increase the GC waterline and increases the GC waterline of the first application. When the electronic device 100 detects that the first application interface is in the sliding end state, the second function (for example, the endDetect() function) of the sliding detection module starts to run, and the sliding detection module sends a notification to restore the GC waterline to the ART, for example, specifically sends a notification to restore the GC waterline to the virtual machine corresponding to the first application in the ART. The virtual machine responds to the notification to restore the GC waterline and restores the GC waterline of the first application.

[0129] In another implementation, when the electronic device 100 detects that the first application interface is frequently in a sliding state (exemplarily, when the electronic device 100 detects that the first application interface is in the sliding start state at least twice within 5 s), the sliding detection module may delay for a certain period of time (e.g., 3 s) to send a notification to the virtual machine to resume the GC waterline when the first application interface is in the sliding end state. It should be noted that the first application triggering the GC control of the electronic device may be a third-party application such as a chat application or a shopping application, or may also be a system application, which is not limited in the embodiments of the present application.

[0130] As Figure 8 shown, a flowchart of a GC control provided by an embodiment of the present application includes but is not limited to the following steps:

[0131] S801: The electronic device 100 calls the sliding detection module in response to a sliding operation on the first application interface.

[0132] S802: The first function of the sliding detection module runs.

[0133] Exemplarily, the first function may be the beginDetect() function of the sliding detection module in the application framework layer.

[0134] S803: The sliding detection module sends a notification to the virtual machine to increase the GC waterline.

[0135] Exemplarily, the sliding detection module (such as FluencyDetector.java) may send the above to the corresponding thread (such as heap.cc) of the virtual machine through methods (such as updateProcessState) via multiple threads (such as VMRuntime.java and scenariogc.cc).

[0136] S804: The virtual machine increases the GC waterline of the first application.

[0137] In response to the notification to increase the GC waterline, the virtual machine increases the GC waterline of the first application from the first waterline value to the second waterline value. For the specific implementation process of this step, reference can be made to the following Figure 9 shown.

[0138] S805: The second function of the sliding detection module runs.

[0139] Exemplarily, the second function may be the endDetect() function of the sliding detection module in the application framework layer.

[0140] S806: The sliding detection module sends a notification to the virtual machine to resume the GC waterline.

[0141] S807: The virtual machine restores the GC waterline of the first application.

[0142] In response to the notification to restore the GC waterline, the virtual machine restores the GC waterline of the first application from the second waterline value to the first waterline value. Exemplarily, for the specific implementation process of this step, reference can be made to the following Figure 10 as shown.

[0143] In some embodiments, the sliding detection module can pass a notification to increase or restore the GC waterline to the virtual machine through JNI calls.

[0144] As Figure 9 shown in the above S804 provided by the embodiments of the present application, the flowchart of the virtual machine executing the process of increasing the GC waterline includes, but is not limited to, the following steps:

[0145] S901: The virtual machine starts to execute the process of increasing the GC waterline.

[0146] In some embodiments, the virtual machine starts to execute the process of increasing the GC waterline when receiving the notification to increase the GC waterline sent by the sliding detection module.

[0147] S902: Determine whether the GC thread of the first application is not working. If so, execute step S903. If not, execute step S909.

[0148] It should be understood that when the GC thread of the first application is working, the virtual machine does not adjust the GC waterline. If the GC waterline is adjusted during the working period of the GC thread, it may cause logical errors in the execution of the GC thread, thus affecting the stability and reliability of the GC thread.

[0149] S903: Determine whether both the free memory corresponding to the first application is less than the preset memory and the last sliding process has been completed. If so, execute S904. If not, execute step S909.

[0150] In some embodiments, the completion of the last sliding process means that the following Figure 11 steps have been executed.

[0151] To prevent the first application from triggering GC and causing the first thread to block when the electronic device 100 performs a sliding operation in the first application interface, resulting in the electronic device 100 becoming stuck during the sliding process, the electronic device 100 can set a preset memory. By increasing the value of the GC waterline by the value of the preset memory, it is prevented that the occupied memory of the first application exceeds the GC waterline during the sliding process of the first application interface. The value of the preset memory can be set by the electronic device 100. Exemplarily, the preset memory can be 200MB.

[0152] In some embodiments, the electronic device may obtain a preset memory through a sliding model. For example, the electronic device may obtain the distribution of the heap space sizes required by multiple applications during sliding through the sliding model, and determine the preset memory according to the distribution of the heap space sizes. Exemplarily, the electronic device may set the value of the heap space required by some applications (such as 95% of the applications) during sliding as the preset memory.

[0153] It should be noted that the preset memory in the embodiments of the present application is not limited. It may be determined by the electronic device according to the memory situation of the first application, or it may be the default value set by the system of the electronic device.

[0154] S904: Record the current heap memory of the first application (also referred to as the first memory value) and the number of times the first application triggers GC.

[0155] In some embodiments, the number of times the first application triggers GC may be represented by gcs_conpleted_.

[0156] S905: Determine whether the difference between the heap memory and the heap memory limit value (i.e., the memory to be allocated) is greater than a preset value after the free memory of the first application increases to the preset memory. If yes, execute step S906; if no, execute step S909.

[0157] Among them, the preset value can avoid affecting the normal operation of the electronic device. It can be understood that the sliding duration is determined by the user. If the GC waterline continuously remains at the maximum waterline value when the sliding duration is too long, it may affect the movement of other threads. For example, setting the preset value can avoid the heap memory overflow caused by raising the GC waterline, resulting in a full garbage collection (Fullgc), which causes the main thread of the first application to be continuously blocked. It should be understood that after the virtual machine raises the GC waterline, the occupied memory of the first application still exceeds the GC waterline and exceeds the heap memory limit value, and the memory to be allocated for the first application is insufficient, resulting in Fullgc, which causes the main thread of the first application to be continuously blocked. If the difference between the heap memory and the heap memory limit value of the first application is greater than the preset value after the free memory of the first application increases to the preset memory, it indicates that the memory to be allocated is sufficient, and even if the first application triggers GC, it will not cause Fullgc. If the difference between the heap memory and the heap memory limit value of the first application is less than the preset value after the free memory of the first application increases to the preset memory, it indicates that the memory to be allocated is insufficient, and it is easy to cause Fullgc after the first application triggers GC.

[0158] Take Figure 10 as an example for illustration. Figure 10 This is a schematic diagram for determining whether to raise the waterline provided by the embodiments of the present application. Figure 10 Exemplarily, it is shown that the limit value of the heap memory of the first application is 512MB;Figure 10 In (A), an example shows the structure of the current heap memory. The initial free memory in the current heap memory is 150MB, and the occupied memory is 200MB. Assuming the preset memory is 200MB, then, as shown in Figure 10 (B), by increasing the new free memory of 50MB in the initial free memory (i.e., 150MB), the target free memory (i.e., 200MB) can be obtained, and the size of the target free memory is the preset memory (i.e., 200MB). At this time, the size of the memory to be allocated in the heap structure of the first application is changed from 162MB to 112MB. If the memory to be allocated is greater than the preset value after the new free memory is added, the virtual machine can perform the operation of raising the GC waterline. For the exemplary detailed process, reference can be made to Figure 11 .

[0159] Exemplarily, the preset value of the first application is 200MB, the preset memory is 200MB, the initial free memory is 150MB, and the occupied memory is 200MB. After the initial free memory of the first application increases to the preset memory (i.e., 200MB), the memory to be allocated of the first application (i.e., 112MB) is greater than the preset value, and the virtual machine executes step S905, that is, raises the heap memory of the first application.

[0160] Also exemplarily, when the heap memory of the first application is too large, such as when the heap memory is 300MB. After the initial free memory of the first application increases to the preset memory, the memory to be allocated of the first application (i.e., 500MB) is less than the preset value, that is, after the initial free memory increases by the margin value (i.e., the above-mentioned new free memory), it is greater than the difference between the heap memory limit value and the preset value, and the margin value is the difference between the initial free memory and the preset value. At this time, the virtual machine executes step S908, that is, ends raising the GC waterline.

[0161] It should be noted that the preset value in the embodiments of the present application is not limited. It can be determined by the electronic device according to the memory situation of the first application, or it can be the default value set by the system of the electronic device.

[0162] S906: Raise the heap memory of the first application.

[0163] Exemplarily, the virtual machine raises the value of the heap memory of the first application from the first memory value to the second memory value, and the second memory value is the first memory value plus the new free memory.

[0164] In some embodiments, the virtual machine can raise the heap memory of the first application through some functions. Exemplarily, the function can be the SetldealFootprint() function.

[0165] S907: Raise the GC waterline of the first application.

[0166] Exemplarily, the virtual machine raises the value of the GC waterline of the first application from the first waterline value to the second waterline value, where the second waterline value is the second memory value minus a preset difference.

[0167] In some embodiments, the virtual machine can raise the GC waterline of the first application through some functions. Exemplarily, the function can be the SetDefaultConcurrentStartBytes() function.

[0168] It should be understood that as described above Figure 1 As shown, the GC waterline is the heap memory minus a preset difference. Therefore, the GC waterline can be increased by increasing the heap memory.

[0169] S908: Set the flag bit to the first value.

[0170] Among them, the flag bit is used to indicate whether the GC waterline of the first application has been raised. Exemplarily, the first value is used to indicate that the GC waterline of the first application has been raised.

[0171] In some embodiments, the virtual machine can set the flag bit indicating that the GC waterline of the first application has been raised, and the virtual machine can judge whether to restore the waterline of the first application according to the set flag bit.

[0172] S909: End raising the GC waterline.

[0173] As Figure 11 As shown, the following is a schematic flowchart of the virtual machine executing the process of restoring the GC waterline in S807 provided by the embodiments of the present application, including but not limited to the following steps:

[0174] S1101: The virtual machine starts to execute the process of restoring the GC waterline.

[0175] In some embodiments, the virtual machine starts to execute the process of restoring the GC waterline when receiving a notification of restoring the GC waterline sent by the sliding detection module.

[0176] S1102: Judge whether the GC waterline of the first application has been raised. If yes, execute step S1103. If not, execute step S1106.

[0177] In some embodiments, the virtual machine can judge whether the GC waterline has been raised by checking the flag bit. Exemplarily, if the flag bit is the first value, it indicates that the current GC waterline has been raised.

[0178] S1103: Judge whether it simultaneously satisfies that the first application does not trigger GC during the sliding process and the current GC collector is not in the working state. If yes, execute step S1104. If not, execute step S1106.

[0179] In some embodiments, the virtual machine can determine whether the first application has triggered a GC during the sliding process by the number of times the first application triggers the GC.

[0180] If the first application triggers a GC during the sliding process, it indicates that after the GC waterline is increased to the second waterline value, the heap memory space is still not enough for use. At this time, the virtual machine can not restore the GC waterline.

[0181] The GC thread uses an allocator and a collector to recycle memory. Among them, the collector is responsible for recycling the so-called garbage memory that is no longer used by the first application. When the GC collector is in the working state, it indicates that the GC thread is working at this time and the GC waterline cannot be adjusted.

[0182] GC uses an allocator and a collector. The allocator is responsible for obtaining more memory and triggering the collector at an appropriate time. The collector is responsible for recycling the object memory (referred to as garbage memory) that is no longer used by the program.

[0183] S1104: Restore the heap memory of the first application and determine whether it is successful. If so, execute step S1105. If not, execute step S1106.

[0184] Exemplarily, the virtual machine restores the value of the heap memory of the first application from the second memory value to the first memory value.

[0185] S1105: Restore the GC waterline of the first application.

[0186] Exemplarily, the virtual machine increases the value of the GC waterline of the first application from the second waterline value to the first waterline value.

[0187] In some embodiments, the virtual machine can restore the GC waterline of the first application through some functions. Exemplarily, the function can be the SetDefaultConcurrentStartBytesLocked() function.

[0188] In some embodiments, the virtual machine can use bytes to represent the second waterline value. Exemplarily, it can be concurrentstartbytes.

[0189] It should be understood that as described above Figure 1 As shown, the GC waterline is the heap memory minus a preset difference. Therefore, the GC waterline can be increased by increasing the heap memory.

[0190] S1106: Set the flag bit to the second value.

[0191] Among them, the flag bit is used to indicate whether the GC waterline of the first application is raised. Exemplarily, the second value is used to indicate that the GC waterline of the first application has been restored.

[0192] In some embodiments, the virtual machine can set the flag bit indicating that the GC waterline of the first application has been restored, and the virtual machine can determine whether to restore the waterline of the first application according to the set flag bit.

[0193] S1107: End the restoration of the GC waterline.

[0194] The term "user interface (UI)" in the specification, claims and drawings of this application is a media interface for interaction and information exchange between an application program or an operating system and a user, and it realizes the conversion between the internal form of information and the form acceptable to the user. The application interface of an application program is source code written in a specific computer language such as Java or Extensible Markup Language (XML). The interface source code is parsed and rendered on the terminal device and finally presented as content recognizable by the user, such as controls like pictures, texts, buttons, etc. A control (also known as a widget) is the basic element of the application interface. Typical controls include a toolbar, a menu bar, a text box, a button, a scrollbar, pictures, and texts. The attributes and content of the controls in the interface are defined by tags or nodes. For example, XML passes through <textview> 、 <imgview> 、 <videoview>Nodes such as these are used to define the controls included in the interface. One node corresponds to one control or property in the interface, and after being parsed and rendered, the node presents as content visible to the user. In addition, in the interfaces of many applications, such as hybrid applications, there are usually web pages included. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is source code written in a specific computer language, such as hyper text markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as content recognizable by the user by a browser or a web page display component similar in function to a browser. The specific content included in the web page is also defined by tags or nodes in the web page source code. For example, HTML uses 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.

[0195] A commonly used form of application interface is a graphic user interface (GUI), which refers to an application interface related to computer operations displayed in a graphical manner. It can be an interface element such as an icon, window, control, etc. displayed on the display screen of an electronic device, where the control can include visible interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, etc.

[0196] It should be understood that each step in the above method embodiments provided by this application can be completed by the integrated logic circuit of the hardware in the processor or the instructions in the form of software. The method steps disclosed in combination with the embodiments of this application can be directly embodied as being executed and completed by the hardware processor, or executed and completed by the combination of the hardware and software modules in the processor.

[0197] This application also provides an electronic device, which may include: a memory and a processor. Among them, the memory can be used to store computer programs; the processor can be used to call the computer programs in the memory so that the electronic device executes the method in any one of the above embodiments.

[0198] This application also provides a chip system, which includes at least one processor for implementing the functions involved in the method executed by the electronic device in any one of the above embodiments. In a possible design, the chip system further includes a memory for storing program instructions and data, and the memory is located inside or outside the processor. The chip system can be composed of chips or can include chips and other discrete devices.

[0199] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor that realizes it by reading the software code stored in the memory.

[0200] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor or can be separately arranged from the processor, and the embodiments of this application do not limit this. Exemplarily, the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip or can be separately arranged on different chips. The embodiments of this application do not make specific limitations on the type of the memory and the setting manner of the memory and the processor.

[0201] Exemplarily, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0202] The present application also provides a computer program product, which includes a computer program (which may also be referred to as code or instruction). When the computer program is run, it causes the computer to execute the method performed by the electronic device in any one of the above embodiments.

[0203] The present application also provides a computer-readable storage medium, which stores a computer program (which may also be referred to as code or instruction). When the computer program is run, it causes the computer to execute the method performed by the electronic device in any one of the above embodiments.

[0204] The various embodiments of the present application can be combined arbitrarily to achieve different technical effects.

[0205] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, fiber optic, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk).

[0206] Those of ordinary skill in the art can understand that all or part of the processes in the above embodiments of the method can be completed by instructing relevant hardware with a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The aforementioned storage medium includes various media that can store program codes, such as ROM or random access memory RAM, magnetic disks, or optical discs.

[0207] In summary, the above are only embodiments of the technical solution of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention shall be included within the protection scope of the present invention.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. An interface display method, applied to an electronic device, characterized in that Including: The electronic device displays a first application interface of the first application; The electronic device responds to a sliding operation on the first application interface and displays multiple second application interfaces of the first application; When the electronic device detects the sliding operation, it raises the GC waterline of the garbage collection (GC) thread corresponding to the first application from a first waterline value to a second waterline value, where the first waterline value is the current waterline value of the GC waterline; After the electronic device displays the multiple second application interfaces, it restores the GC waterline from the second waterline value to the first waterline value.

2. The method according to claim 1, characterized in that The raising of the GC waterline of the garbage collection (GC) thread corresponding to the first application from a first waterline value to a second waterline value includes: The electronic device determines the working state of the GC thread in response to the sliding operation; When the electronic device determines that the GC thread is in a non-working state, it raises the GC waterline from the first waterline value to the second waterline value.

3. The method according to claim 1 or 2, characterized in that, The raising of the GC waterline of the garbage collection (GC) thread corresponding to the first application from a first waterline value to a second waterline value includes: When the electronic device determines that the free memory corresponding to the first application is less than a preset memory and the previous sliding process is completed, it raises the GC waterline from the first waterline value to the second waterline value, where the preset memory is not less than the memory required to slide the application interface of the first application.

4. The method according to claim 3, characterized in that The raising of the GC waterline from the first waterline value to the second waterline value includes: When the electronic device determines that the free memory corresponding to the first application has increased to the preset memory and the difference between the heap memory corresponding to the first application and the heap memory limit value corresponding to the first application is greater than a preset value, it raises the GC waterline from the first waterline value to the second waterline value; the heap memory corresponding to the first application includes the sum of the free memory and the occupied memory corresponding to the first application.

5. The method according to any one of claims 1-4, characterized in that Before raising the GC waterline of the garbage collection (GC) thread corresponding to the first application from a first waterline value to a second waterline value, the method further includes: The electronic device stores the current heap memory corresponding to the first application to obtain a first memory value; The electronic device raises the heap memory of the first application from the first memory value to a second memory value; The raising of the GC waterline of the garbage collection (GC) thread corresponding to the first application from a first waterline value to a second waterline value includes: The electronic device raises the GC waterline to the second waterline value based on the second memory value.

6. The method according to claim 5, characterized in that, The method further includes: The electronic device responds to the sliding operation and displays a third application interface after displaying the multiple second application interfaces; After the electronic device displays the multiple second application interfaces, the restoration of the GC waterline from the second waterline value to the first waterline value includes: When the GC thread is not working during the process of displaying the multiple second application interfaces and the third application interface, the electronic device restores the GC waterline from the second waterline value to the first waterline value after displaying the third application interface.

7. The method according to claim 6, wherein Restoring the GC waterline from the second waterline value to the first waterline value includes: The electronic device restores the heap memory of the first application from the second memory value to the first memory value; Based on the first memory value, the electronic device restores the GC waterline from the second waterline value to the first waterline value.

8. The method according to claim 6, characterized in that, Before raising the GC waterline of the garbage collection (GC) thread corresponding to the first application from the first waterline value to the second waterline value, the method further includes: The electronic device stores the number of working times of the GC thread to obtain a first number; If the number of working times of the GC thread is the first number after the electronic device displays the third application interface, the electronic device determines that the GC thread does not work during the process of displaying the plurality of second application interfaces and the third application interface.

9. The method according to any one of claims 1-8, characterized in that, The electronic device displays the first application interface of the first application, including: The electronic device displays an application window of the first application, and the application window includes a sliding area; The electronic device displays the first application interface in the application window; The electronic device responds to a sliding operation on the first application interface and displays a plurality of second application interfaces of the first application, including: the electronic device responds to a sliding operation on the sliding area and displays a plurality of second application interfaces of the first application in the window interface.

10. The method according to claim 9, characterized in that, The sliding operation is used to indicate interface update of the application window; the plurality of second application interfaces of the first application are application interfaces displayed during the interface update process of the application window.

11. An electronic device, characterized in that, It includes one or more processors and one or more memories; wherein, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the method according to any one of claims 1-10 is executed.

12. A computer-readable storage medium, comprising instructions, characterized in that, When the instruction runs on the electronic device, the method according to any one of claims 1-10 is executed.