Commit af2a611a authored by vipwzw's avatar vipwzw Committed by 33cn

fix mem usage

parent 3b60ed75
......@@ -3,7 +3,6 @@ package executor
import (
"bytes"
"encoding/json"
"fmt"
"sync"
"sync/atomic"
......@@ -237,7 +236,6 @@ func (u *js) execnameFunc(vm *otto.Otto, name string) {
func (u *js) randnumFunc(vm *otto.Otto, name string) {
vm.Set("randnum", func(call otto.FunctionCall) otto.Value {
hash := u.GetLastHash()
fmt.Println("-----randnum", common.ToHex(hash))
param := &types.ReqRandHash{
ExecName: "ticket",
BlockNum: 5,
......
......@@ -192,8 +192,9 @@ func TestCacheMemUsage(t *testing.T) {
e := initExec(ldb, kvdb, jscode, t)
vm, err := e.createVM("test", nil, 0)
assert.Nil(t, err)
vms := make([]*otto.Otto, 1024)
for i := 0; i < 1024; i++ {
n := 64
vms := make([]*otto.Otto, n)
for i := 0; i < n; i++ {
vms[i] = vm.Copy()
}
printMemUsage()
......
......@@ -130,12 +130,12 @@ count=10000
[[consensus.sub.ticket.genesis]]
minerAddr="1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"
returnAddr="1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF"
count=10000
count=1000
[[consensus.sub.ticket.genesis]]
minerAddr="1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX"
returnAddr="1KcCVZLSQYRUwE5EXTsAoQs9LuJW6xwfQa"
count=10000
count=1000
[store]
name="mavl"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment