-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
there is a problem when using these kind of .xlsx files
in GetRows funciton it will add all rows and it will allocate huge amount of memory and then it will use only 0:max elements untill GC clocks
makes it unable to run service with limited memory
here is the file to reproduce it :
- add the following lines to (rows.go#L77):
fmt.Println(max)
fmt.Println(len(results)) - read it normally and check the memory usage with this code after reading it:
var memStats runtime.MemStats
runtime.ReadMemStats(&memStats)
fmt.Printf("memory allocated: %d\n", memStats.Alloc)
runtime.GC()
runtime.ReadMemStats(&memStats)
fmt.Printf("memory allocated 2: %d\n", memStats.Alloc)
difference between 2 prints is the unnecessary allocation
https://github.com/qax-os/excelize/blob/master/rows.go#L61-L79
Metadata
Metadata
Assignees
Labels
No labels