You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
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 :
cost_center_matrix.xlsx
fmt.Println(max)
fmt.Println(len(results))
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
The text was updated successfully, but these errors were encountered: