1 回答

TA貢獻1884條經驗 獲得超4個贊
分析堆棧跟蹤,看起來您正試圖在此處分配一個太大的切片:db_template.XCludeList.getAllCombinationComplex()
indexdb/db_template.XCludeList.getAllCombinationComplex(0xea4382c480, 0x8, 0x9, 0xe4ec1dc460, 0x4, 0x4, 0x0, 0x0, 0x0)
/home/scmbuild/workspaces_cluster/index/src/indexdb/db_template/db.go:145 +0x371 fp=0xea27f3ca88 sp=0xea27f3c900
這稱為runtime.makeslice():
runtime.makeslice(0xa38840, 0x3ecc38680, 0x3ecc38680, 0x0, 0x0, 0x0)
/usr/local/go1.6.2/src/runtime/slice.go:32 +0x165 fp=0xea27f3c900 sp=0xea27f3c8b0
Go 1.6的源代碼runtime.makeslice()在這里:slice.go:
func makeslice(t *slicetype, len64, cap64 int64) slice {
...
}
它是用參數調用的:
runtime.makeslice(0xa38840, 0x3ecc38680, 0x3ecc38680, 0x0, 0x0, 0x0)
第二個值是長度,即
0x3ecc38680 = 16857138816
您試圖創建一個包含超過 16*10 9 個元素的切片。如果切片的元素類型需要至少 1 個字節(不包括零大小的類型),則大約為 16 GB!這只是一個較低的估計。顯然,在 8 GB 可用 RAM 的情況下,此操作無法成功。
另外,請更新您的 Go,1.6.2 已經快 3 年了,不再受支持(甚至沒有收到安全補?。?。
- 1 回答
- 0 關注
- 145 瀏覽
添加回答
舉報