Skip to content

Commit

Permalink
fix(sqlserver): 修复内存分配计算的问题 #8008
Browse files Browse the repository at this point in the history
  • Loading branch information
yksitu authored and iSecloud committed Nov 22, 2024
1 parent e399964 commit 5eb554b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ func (i *InstallSqlServerComp) InitInstanceBuffer() error {
// 计算每个实例分配到内存
var secondUsedMem float32 = 0
usedMem := float32(mem.Total) * (float32(i.Params.BufferPercent) / 100)
if usedMem > float32(i.Params.MaxRemainMemGB*1024*1024*1024) {
secondUsedMem = usedMem - float32(i.Params.MaxRemainMemGB*1024*1024*1024)
if (float32(mem.Total) - usedMem) > float32(i.Params.MaxRemainMemGB*1024*1024*1024) {
secondUsedMem = (float32(mem.Total) - usedMem) - float32(i.Params.MaxRemainMemGB*1024*1024*1024)
}
instMemMB := (usedMem + secondUsedMem) / float32(len(i.InsPorts)) / 1024 / 1024
logger.Info("%d", int(instMemMB))
Expand Down

0 comments on commit 5eb554b

Please sign in to comment.