Replies: 1 comment 4 replies
-
The string leaks are regex source and compiled data. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My system is running a test case in a loop. After dozens of runs, I found that the allocated memory has increased by 2MB compared to the initial state. I want to analyze the memory leak by DUMP_LEAKS information, but I don't know how to analyze it based on the information. Could you please give me some good suggestions?
Here's the DUMP_LEAKS info, and I intercepted some of it.
dump memory:
QuickJS memory usage , 32-bit, malloc limit: 10485760
NAME COUNT SIZE
memory allocated 81130 7433272 (91.6 per block)
memory used 79433 5071871 (8 overhead, 29.7 average slack)
atoms 8397 449007 (53.5 per atom)
strings 28014 1576240 (56.3 per string)
objects 14912 715776 (48.0 per object)
properties 43456 382144 (2.9 per object)
shapes 1046 169536 (162.1 per shape)
bytecode functions 6060 1033904
bytecode 6060 615119 (101.5 per function)
pc2line 1 1 (1.0 per function)
C functions 264
arrays 1266
fast arrays 1266
elements 15048 120384 (11.9 per fast array)
binary objects 1 1054015
I guess it's probably the leakage of string and atom, but after a preliminary look at atom, there are some constant strings, which should be fixed values and will not increase continuously.
The string contains a large number of variables. It is estimated that the problem is caused by this problem, but I do not know how to locate the problem.
Memory leakage occurs when the JS_FreeRuntime interface is used,
leaks info:



object leaks just a little.
atom leaks have More than 8,000.
String leaks are very many.
Memory leak: 3929960 bytes lost in 44692 blocks
Beta Was this translation helpful? Give feedback.
All reactions