Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
5596b664
Commit
5596b664
authored
Sep 11, 2017
by
Felix Lange
Committed by
GitHub
Sep 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal/debug: add debug_freeOSMemory (#15122)
parent
10181b57
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
71 deletions
+68
-71
api.go
internal/debug/api.go
+5
-0
web3ext.go
internal/web3ext/web3ext.go
+63
-71
No files found.
internal/debug/api.go
View file @
5596b664
...
@@ -176,6 +176,11 @@ func (*HandlerT) Stacks() string {
...
@@ -176,6 +176,11 @@ func (*HandlerT) Stacks() string {
return
string
(
buf
)
return
string
(
buf
)
}
}
// FreeOSMemory returns unused memory to the OS.
func
(
*
HandlerT
)
FreeOSMemory
()
{
debug
.
FreeOSMemory
()
}
func
writeProfile
(
name
,
file
string
)
error
{
func
writeProfile
(
name
,
file
string
)
error
{
p
:=
pprof
.
Lookup
(
name
)
p
:=
pprof
.
Lookup
(
name
)
log
.
Info
(
"Writing profile records"
,
"count"
,
p
.
Count
(),
"type"
,
name
,
"dump"
,
file
)
log
.
Info
(
"Writing profile records"
,
"count"
,
p
.
Count
(),
"type"
,
name
,
"dump"
,
file
)
...
...
internal/web3ext/web3ext.go
View file @
5596b664
...
@@ -35,8 +35,7 @@ var Modules = map[string]string{
...
@@ -35,8 +35,7 @@ var Modules = map[string]string{
const
Chequebook_JS
=
`
const
Chequebook_JS
=
`
web3._extend({
web3._extend({
property: 'chequebook',
property: 'chequebook',
methods:
methods: [
[
new web3._extend.Method({
new web3._extend.Method({
name: 'deposit',
name: 'deposit',
call: 'chequebook_deposit',
call: 'chequebook_deposit',
...
@@ -67,8 +66,7 @@ web3._extend({
...
@@ -67,8 +66,7 @@ web3._extend({
const
Clique_JS
=
`
const
Clique_JS
=
`
web3._extend({
web3._extend({
property: 'clique',
property: 'clique',
methods:
methods: [
[
new web3._extend.Method({
new web3._extend.Method({
name: 'getSnapshot',
name: 'getSnapshot',
call: 'clique_getSnapshot',
call: 'clique_getSnapshot',
...
@@ -100,10 +98,9 @@ web3._extend({
...
@@ -100,10 +98,9 @@ web3._extend({
name: 'discard',
name: 'discard',
call: 'clique_discard',
call: 'clique_discard',
params: 1
params: 1
})
})
,
],
],
properties:
properties: [
[
new web3._extend.Property({
new web3._extend.Property({
name: 'proposals',
name: 'proposals',
getter: 'clique_proposals'
getter: 'clique_proposals'
...
@@ -115,8 +112,7 @@ web3._extend({
...
@@ -115,8 +112,7 @@ web3._extend({
const
Admin_JS
=
`
const
Admin_JS
=
`
web3._extend({
web3._extend({
property: 'admin',
property: 'admin',
methods:
methods: [
[
new web3._extend.Method({
new web3._extend.Method({
name: 'addPeer',
name: 'addPeer',
call: 'admin_addPeer',
call: 'admin_addPeer',
...
@@ -162,10 +158,9 @@ web3._extend({
...
@@ -162,10 +158,9 @@ web3._extend({
new web3._extend.Method({
new web3._extend.Method({
name: 'stopWS',
name: 'stopWS',
call: 'admin_stopWS'
call: 'admin_stopWS'
})
})
,
],
],
properties:
properties: [
[
new web3._extend.Property({
new web3._extend.Property({
name: 'nodeInfo',
name: 'nodeInfo',
getter: 'admin_nodeInfo'
getter: 'admin_nodeInfo'
...
@@ -177,7 +172,7 @@ web3._extend({
...
@@ -177,7 +172,7 @@ web3._extend({
new web3._extend.Property({
new web3._extend.Property({
name: 'datadir',
name: 'datadir',
getter: 'admin_datadir'
getter: 'admin_datadir'
})
})
,
]
]
});
});
`
`
...
@@ -185,8 +180,7 @@ web3._extend({
...
@@ -185,8 +180,7 @@ web3._extend({
const
Debug_JS
=
`
const
Debug_JS
=
`
web3._extend({
web3._extend({
property: 'debug',
property: 'debug',
methods:
methods: [
[
new web3._extend.Method({
new web3._extend.Method({
name: 'printBlock',
name: 'printBlock',
call: 'debug_printBlock',
call: 'debug_printBlock',
...
@@ -268,6 +262,11 @@ web3._extend({
...
@@ -268,6 +262,11 @@ web3._extend({
params: 0,
params: 0,
outputFormatter: console.log
outputFormatter: console.log
}),
}),
new web3._extend.Method({
name: 'freeOSMemory',
call: 'debug_freeOSMemory',
params: 0,
}),
new web3._extend.Method({
new web3._extend.Method({
name: 'memStats',
name: 'memStats',
call: 'debug_memStats',
call: 'debug_memStats',
...
@@ -358,8 +357,7 @@ web3._extend({
...
@@ -358,8 +357,7 @@ web3._extend({
const
Eth_JS
=
`
const
Eth_JS
=
`
web3._extend({
web3._extend({
property: 'eth',
property: 'eth',
methods:
methods: [
[
new web3._extend.Method({
new web3._extend.Method({
name: 'sign',
name: 'sign',
call: 'eth_sign',
call: 'eth_sign',
...
@@ -396,10 +394,9 @@ web3._extend({
...
@@ -396,10 +394,9 @@ web3._extend({
},
},
params: 2,
params: 2,
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.utils.toHex]
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.utils.toHex]
})
})
,
],
],
properties:
properties: [
[
new web3._extend.Property({
new web3._extend.Property({
name: 'pendingTransactions',
name: 'pendingTransactions',
getter: 'eth_pendingTransactions',
getter: 'eth_pendingTransactions',
...
@@ -411,7 +408,7 @@ web3._extend({
...
@@ -411,7 +408,7 @@ web3._extend({
}
}
return formatted;
return formatted;
}
}
})
})
,
]
]
});
});
`
`
...
@@ -419,8 +416,7 @@ web3._extend({
...
@@ -419,8 +416,7 @@ web3._extend({
const
Miner_JS
=
`
const
Miner_JS
=
`
web3._extend({
web3._extend({
property: 'miner',
property: 'miner',
methods:
methods: [
[
new web3._extend.Method({
new web3._extend.Method({
name: 'start',
name: 'start',
call: 'miner_start',
call: 'miner_start',
...
@@ -451,7 +447,7 @@ web3._extend({
...
@@ -451,7 +447,7 @@ web3._extend({
new web3._extend.Method({
new web3._extend.Method({
name: 'getHashrate',
name: 'getHashrate',
call: 'miner_getHashrate'
call: 'miner_getHashrate'
})
})
,
],
],
properties: []
properties: []
});
});
...
@@ -461,12 +457,11 @@ const Net_JS = `
...
@@ -461,12 +457,11 @@ const Net_JS = `
web3._extend({
web3._extend({
property: 'net',
property: 'net',
methods: [],
methods: [],
properties:
properties: [
[
new web3._extend.Property({
new web3._extend.Property({
name: 'version',
name: 'version',
getter: 'net_version'
getter: 'net_version'
})
})
,
]
]
});
});
`
`
...
@@ -474,8 +469,7 @@ web3._extend({
...
@@ -474,8 +469,7 @@ web3._extend({
const
Personal_JS
=
`
const
Personal_JS
=
`
web3._extend({
web3._extend({
property: 'personal',
property: 'personal',
methods:
methods: [
[
new web3._extend.Method({
new web3._extend.Method({
name: 'importRawKey',
name: 'importRawKey',
call: 'personal_importRawKey',
call: 'personal_importRawKey',
...
@@ -501,14 +495,13 @@ web3._extend({
...
@@ -501,14 +495,13 @@ web3._extend({
name: 'deriveAccount',
name: 'deriveAccount',
call: 'personal_deriveAccount',
call: 'personal_deriveAccount',
params: 3
params: 3
})
})
,
],
],
properties:
properties: [
[
new web3._extend.Property({
new web3._extend.Property({
name: 'listWallets',
name: 'listWallets',
getter: 'personal_listWallets'
getter: 'personal_listWallets'
})
})
,
]
]
})
})
`
`
...
@@ -517,12 +510,11 @@ const RPC_JS = `
...
@@ -517,12 +510,11 @@ const RPC_JS = `
web3._extend({
web3._extend({
property: 'rpc',
property: 'rpc',
methods: [],
methods: [],
properties:
properties: [
[
new web3._extend.Property({
new web3._extend.Property({
name: 'modules',
name: 'modules',
getter: 'rpc_modules'
getter: 'rpc_modules'
})
})
,
]
]
});
});
`
`
...
@@ -633,7 +625,7 @@ web3._extend({
...
@@ -633,7 +625,7 @@ web3._extend({
name: 'newMessageFilter',
name: 'newMessageFilter',
call: 'shh_newMessageFilter',
call: 'shh_newMessageFilter',
params: 1
params: 1
})
})
,
],
],
properties:
properties:
[
[
...
@@ -669,7 +661,7 @@ web3._extend({
...
@@ -669,7 +661,7 @@ web3._extend({
name: 'listmounts',
name: 'listmounts',
call: 'swarmfs_listmounts',
call: 'swarmfs_listmounts',
params: 0
params: 0
})
})
,
]
]
});
});
`
`
...
@@ -696,7 +688,7 @@ web3._extend({
...
@@ -696,7 +688,7 @@ web3._extend({
status.queued = web3._extend.utils.toDecimal(status.queued);
status.queued = web3._extend.utils.toDecimal(status.queued);
return status;
return status;
}
}
})
})
,
]
]
});
});
`
`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment