Skip to content

Commit

Permalink
fix: cache mem too large
Browse files Browse the repository at this point in the history
  • Loading branch information
jayantxie committed Sep 13, 2024
1 parent 217097a commit a2379f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/proc/mem.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import (
"github.com/go-delve/delve/pkg/proc"
)

const cacheEnabled = true
const (
cacheEnabled = true
cacheThreshold = 1024 * 1024 * 1024 // 1GB
)

type memCache struct {
loaded bool
Expand Down Expand Up @@ -68,6 +71,9 @@ func cacheMemory(mem proc.MemoryReadWriter, addr uint64, size int) proc.MemoryRe
// overflow
return mem
}
if size > cacheThreshold {
return mem
}
switch cacheMem := mem.(type) {
case *memCache:
if cacheMem.contains(addr, size) {
Expand Down

0 comments on commit a2379f0

Please sign in to comment.