Comments (6)
another point worth paying attention to, runtime/debug.WriteHeapDump
will store *_type
to typecache
from goloader.
This memory cannot be released.
remove itab from itabtable to avoid invalid address errors if it is not allocated to the same block of memory during load the same obj file again.
from goloader.
Also it's worth noting that this code path is only hit for relatively infrequent dynamic interface assignments (not static ones, where an itab would have been emitted by the compiler and so would be in mmapped memory instead)
from goloader.
another point worth paying attention to,
runtime/debug.WriteHeapDump
will store*_type
totypecache
@fumeboy
This seems to be only used during call heapdump.
*_type is stored in typecache, but it only use pointer for comparison. If the type does not exist, adding it.
it seems does not cause problem, but it retains useless data.
I tested dump heap when loaded the module, and dump heap after unload module, the process exits as normal
from goloader.
Yeah, types are only dumped which are currently in the itabtable, so old types that have been cached are never indirected (they should eventually get bumped off the bucket of 4 if enough hash collisions happen).
from goloader.
https://github.com/golang/go/blob/a031f4ef83edc132d5f49382bfef491161de2476/src/reflect/type.go#L1558
reflect
's lookupCache will also keep pointer to _type, and it is safe to delete.
from goloader.
Related Issues (20)
- 实现 MarshalJSON 接口方法, 不会被执行 HOT 16
- Will panic soon when visit pprof web page HOT 7
- the handle of inline is incorrect HOT 11
- the usage of `copy2Slice` here seems to be incorrect, PutInt64 should be used instead HOT 30
- the `addfuncdata` rewrite `0` to `^uint32(0)`, but ignoring the case where 0 represents a normal offset value. HOT 5
- during module unloading, removing the itab can lead to runtime error HOT 1
- golang 1.21 support HOT 5
- 似乎不支援泛型 HOT 12
- `typelinksRegister` may bind wrong address when some types have same name at packages which also have same name HOT 3
- unexpected return pc 0x0 HOT 4
- Failed to execute plugin which contains dependency `unresolve external:<...>` HOT 2
- build constraints exclude all Go files in ... HOT 2
- there may be an omission of pcdata handling HOT 2
- go linker dont use ptrsize to align TEXT symbol
- may be a bug: the program handles the`findfunctab` does not consider the case where the function address spans 4kb HOT 2
- support golang 1.22 HOT 1
- Discussion on go plugin ecosystem HOT 3
- 内置接口类型 error 无法解析 HOT 5
- //go:linkname lock down future use HOT 2
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 goloader.