Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] MemoryUtils.GetWindowsMetrics 的不正常输出 #192

Closed
PRO-2684 opened this issue Oct 20, 2023 · 7 comments
Closed

[Bug] MemoryUtils.GetWindowsMetrics 的不正常输出 #192

PRO-2684 opened this issue Oct 20, 2023 · 7 comments
Labels
bug Something isn't working need more infomation question Further information is requested

Comments

@PRO-2684
Copy link

Describe the bug

之前是好的,不知道什么时候开始启动任意核心均会出现此问题

Steps to reproduce the bug

启动游戏

Expected behavior

No response

Environment

Windows 11 22H2
Launcher 2.2.3.0

Attachment

Message: Index was outside the bounds of the array.
HelpLink: 
======================================== InnerException:  ========================================
Source: Natsurainko.FluentCore
StackTrace:    at Nrk.FluentCore.Utils.MemoryUtils.GetWindowsMetrics()
   at Nrk.FluentCore.Utils.MemoryUtils.CalculateJavaMemory(Int32 min)
   at Natsurainko.FluentLauncher.Services.Launch.LaunchService.<>c__DisplayClass13_0.<CreateLaunchProcess>b__3()
   at Natsurainko.FluentLauncher.Components.Launch.LaunchProcess.RunLaunch()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

image

@PRO-2684 PRO-2684 added the bug Something isn't working label Oct 20, 2023
@natsurainko
Copy link
Member

尝试手动在cmd中执行这条语句 看看输出是怎么样的

powershell -NoLogo -NonInteractive -Command "Get-CIMInstance Win32_OperatingSystem | Select FreePhysicalMemory,TotalVisibleMemorySize | Format-List"

我这里是这样的
image

@natsurainko natsurainko changed the title Index was outside the bounds of the array [Bug] MemoryUtils.GetWindowsMetrics 的不正常输出 Oct 21, 2023
@natsurainko natsurainko added question Further information is requested need more infomation labels Oct 21, 2023
@PRO-2684
Copy link
Author

FreePhysicalMemory     : 7192808
TotalVisibleMemorySize : 16555320

@natsurainko
Copy link
Member

natsurainko commented Oct 21, 2023

emmmmm 看起来应该没有问题 每次启动的时候都这样吗

@PRO-2684
Copy link
Author

是这样,没法启动任何核心

@natsurainko
Copy link
Member

emmmmmm 暂时先把自动设置内存关掉吧
也不太清楚是哪里不对

@PRO-2684
Copy link
Author

还是这个问题,重置以及卸载重装也没有用
image

@natsurainko
Copy link
Member

image

继续改了一下获取内存的方式
现在改成直接调win32函数的方法,看看还有没有问题

natsurainko added a commit that referenced this issue Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need more infomation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants