Comments (3)
Hi. Although this is not the most optimal usage scenario, the code does not contain memory leaks. How do you measure the memory usage? Could you try running it with GODEBUG=gctrace=1?
from goja.
Thank you, i don't known how to measure the memory usage.
i just run it on windows and look in the task manager.
After half an hour, memory is back below 100Mīŧ It may not be a memory leak . đ
this is try running it with GODEBUG=gctrace=1 logs, i removed some unhelpful log
gc 1 @0.309s 0%: 0+210+0 ms clock, 0+522/210/58+0 ms cpu, 83->84->77 MB, 84 MB goal, 4 P
gc 2 @0.532s 0%: 0+413+2.0 ms clock, 0+11/409/431+8.1 ms cpu, 78->95->93 MB, 154 MB goal, 4 P
gc 3 @1.283s 0%: 2017/12/27 19:41:41 a.js init
+262/488/0+0 ms cpu, 130->154->96 MB, 187 MB goal, 4 P
gc 4 @2.097s 0%: 0+375+0 ms clock, 0+167/374/58+0 ms cpu, 144->161->73 MB, 193 MB goal, 4 P
gc 5 @2.784s 0%: 0+245+0 ms clock, 0+191/244/33+0 ms cpu, 119->129->57 MB, 146 MB goal, 4 P
gc 6 @3.312s 0%: 1.0+186+0 ms clock, 4.0+196/185/0+0 ms cpu, 97->104->47 MB, 115 MB goal, 4 P
gc 7 @3.737s 0%: 0+150+0 ms clock, 0+194/149/0+0 ms cpu, 81->86->39 MB, 94 MB goal, 4 P
gc 8 @4.078s 0%: 0+147+0.50 ms clock, 0+88/145/81+2.0 ms cpu, 68->72->33 MB, 79 MB goal, 4 P
gc 9 @4.399s 0%: 0+98+0 ms clock, 0+157/97/0+0 ms cpu, 59->62->27 MB, 66 MB goal, 4 P
gc 10 @4.643s 0%: 0+85+0 ms clock, 0+127/84/0+0 ms cpu, 49->52->23 MB, 55 MB goal, 4 P
gc 11 @4.851s 0%: 0+75+0 ms clock, 0+55/74/56+0 ms cpu, 42->44->20 MB, 47 MB goal, 4 P
gc 12 @5.035s 0%: 0+59+0 ms clock, 0+101/58/0+0 ms cpu, 37->38->17 MB, 41 MB goal, 4 P
gc 13 @5.214s 0%: 0+60+0 ms clock, 0+27/60/56+0 ms cpu, 31->32->14 MB, 34 MB goal, 4 P
gc 14 @5.356s 0%: 0+40+0 ms clock, 0+68/39/0+0 ms cpu, 27->28->12 MB, 29 MB goal, 4 P
gc 15 @5.463s 0%: 0+34+0 ms clock, 0+60/33/0+0 ms cpu, 22->23->10 MB, 25 MB goal, 4 P
gc 16 @5.551s 0%: 1.0+32+0 ms clock, 4.0+41/31/4.0+02017/12/27 19:41:45 a.js init
ms cpu, 19->20->9 MB, 21 MB goal, 4 P
gc 17 @5.633s 0%: 0+28+0 ms clock, 0+41/27/0+0 ms cpu, 17->17->8 MB, 18 MB goal, 4 P
gc 18 @5.709s 0%: 0+23+0 ms clock, 0+35/23/0+0 ms cpu, 14->15->7 MB, 16 MB goal, 4 P
gc 2017/12/27 19:41:45 a.js init
@5.769s 0%: 2017/12/27 19:41:45 a.js foo()
gc 20 @5.822s 0%: 0+18+0 ms clock, 0+19/18/0+0 ms cpu, 11->11->5 MB, 12 MB goal, 4 P
gc 21 @5.868s 0%: 0+15+0 ms clock, 0+3.9/14/14+0 ms cpu, 9->10->4 MB, 11 MB goal, 4 P
gc 22 @5.909s 0%: 2017/12/27 19:41:45 a.js init
from goja.
Go does not free OS memory immediately, there is a background process that will do it eventually but there are no guarantees as to when.
from goja.
Related Issues (20)
- how to impove performance for a amount of constant literal in a javascript file HOT 4
- vm reuse problem HOT 2
- Request for Assistance: Obtaining Abstract Syntax Tree (AST) with Goja HOT 1
- How to limit the number of for loops HOT 1
- Fibers/Coroutines HOT 4
- Builtin Date locale's methods ignore locale argument HOT 1
- Export JS array to Go slice HOT 2
- if i want to let users do js on my server like cloudflare workers, is it possible to use your repo to do so? HOT 1
- abnormal string input to js function HOT 1
- Go binding for function rest params does not work as expected HOT 2
- how to register custom object into goja like before? HOT 3
- Listing class properties HOT 5
- Circular References Memory Leak HOT 1
- BUG: String.split on an empty string may produces unexpected results HOT 1
- Runtime clears its own interrupt HOT 1
- Object.keys with map[int]any will return <int Value> HOT 2
- RegExp dont support dotAll flag
- how to get script real line number? HOT 2
- Is it normal for this JavaScript code to run slowly? HOT 1
- go<->js interop: map forEach HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goja.