Visual analysis and management method and system for JavaScript memory, equipment and storage medium

A management method and memory technology, which is applied in the direction of file system, file system management, structured data retrieval, etc., can solve the problems of not paying attention to code performance, high learning cost, and high technical ability requirements of front-end developers, so as to reduce learning cost and labor costs, and the effect of improving code quality

Pending Publication Date: 2021-11-23
济南浪潮数据技术有限公司
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In the current front-end development field, the runtime memory analysis of JavaScript code is strongly dependent on the browser (some browsers do not provide this function), and the operation is complicated and not intuitive enough. JavaScript developers need to manually operate and manually analyze and locate problem codes. High technical r

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Visual analysis and management method and system for JavaScript memory, equipment and storage medium
  • Visual analysis and management method and system for JavaScript memory, equipment and storage medium
  • Visual analysis and management method and system for JavaScript memory, equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Example Embodiment

[0040] Example 1

[0041] Embodiment 1 of the present invention proposes a JavaScript memory visualization analysis and management method. On the one hand, the memory monitoring data when the JavaScript code is running can be rendered in real time, and the heap memory snapshot can be saved, and on the other hand, the execution context stack (call stack) of the JavaScript code can be drawn. The relationship graph identifies problem nodes and their calling paths, so that JavaScript developers can simply and clearly understand the underlying operations during code execution, and visually track changes in memory usage.

[0042] like figure 1 A road map of the JavaScript memory visualization analysis and management method in Embodiment 1 of the present invention;

[0043] In step S101, the JavaScript target code is parsed, and the corresponding abstract syntax tree and the scope of the variable are generated;

[0044]In this step, lexical analysis and syntax analysis are first pe...

Example Embodiment

[0065] Example 2

[0066] Based on the JavaScript memory visual analysis and management method proposed in Embodiment 1 of the present invention, the second embodiment of the present invention also proposes a JavaScript memory visual analysis and management system, such as image 3 A schematic diagram of a JavaScript memory visual analysis and management system according to Embodiment 2 of the present invention is given, and the system includes a code pre-parsing device, a data acquisition device, and a visual rendering device;

[0067] The code pre-parsing device is used to parse the JavaScript object code, and generate the corresponding abstract syntax tree and the scope of the variable;

[0068] The data acquisition device is used to run the JavaScript target code, record the execution context stack and heap memory snapshot information during the code running process,

[0069] The visual rendering device is used for rendering the JavaScript heap memory occupancy in real ti...

Example Embodiment

[0088] Example 3

[0089] The present invention also proposes a device, comprising:

[0090] memory for storing computer programs;

[0091] The processor implements the method steps as follows when executing the computer program:

[0092] In step S101, the JavaScript target code is parsed, and the corresponding abstract syntax tree and the scope of the variable are generated;

[0093] In this step, lexical analysis and syntax analysis are first performed on the JavaScript code to generate the corresponding AST abstract syntax tree, the scope of variables and the scope chain of functions.

[0094] Among them, Abstract Syntax Tree (AST): An abstract representation of the grammatical structure of the source code, which represents the grammatical structure of the programming language in the form of a tree, and each node on the tree represents a structure in the source code.

[0095] According to the common memory leak tracking library, statically analyze the JavaScript object c...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention provides a visual analysis and management method and system for a JavaScript memory, equipment and a storage medium. The method comprises the following steps: analyzing a target code, and generating a corresponding abstract syntax tree and an action range of a variable; running the target code, and recording the execution context stack and heap memory snapshot information in the code running process; and according to the abstract syntax tree, executing the context stack and heap memory snapshot information, rendering the occupation condition of the heap memory in real time, and drawing a calling relation graph among variable nodes in the action range. The method further comprises the steps that according to a common memory leak tracking library, static analysis is conducted on target codes, and the action range of the problems possibly causing leak is marked. A visual analysis and management system, equipment and a storage medium are further provided based on the method, an effective way for conveniently and visually analyzing the problems of memory leak and the like is provided, the learning cost and the labor cost of code performance analysis and optimization are reduced, and a front-end development team can integrally control the code performance.

Description

technical field [0001] The invention belongs to the technical field of data analysis and management, and in particular relates to a JavaScript memory visualization analysis and management method, system, device and storage medium. Background technique [0002] JavaScript, referred to as JS, is a literal scripting language. It is a dynamically typed, weakly typed, prototype-based language with built-in support for types. Its interpreter is called the JavaScript engine, which is a part of the browser and is widely used as a client-side scripting language. It was first used on HTML (an application under the standard general markup language) webpage to add dynamic functions to HTML webpages. . [0003] In the current front-end development field, the runtime memory analysis of JavaScript code is strongly dependent on the browser (some browsers do not provide this function), and the operation is complicated and not intuitive enough. JavaScript developers need to manually operate ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F16/28G06F16/11G06F11/36G06F8/30G06F40/253
Inventor 贾少龙符佳凤
Owner 济南浪潮数据技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products