Skip to content

Huge memory usage #2388

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

Closed
kussumma opened this issue Feb 10, 2025 · 5 comments
Closed

Huge memory usage #2388

kussumma opened this issue Feb 10, 2025 · 5 comments
Labels
Need to be fixed Need to be fixed

Comments

@kussumma
Copy link

Describe the bug
Thanks for the awsome app. Usually Stats use less than 100 mb RAM, but now it use > 400 mb RAM

Details:

  • Device: Macbook Air M3 chip
  • macOS: 15.3
  • Application version: 2.11.30 (latest)
Image Image
@exelban exelban added the Need to be fixed Need to be fixed label Feb 10, 2025
@exelban exelban added this to Stats Feb 10, 2025
@exelban exelban moved this to Todo in Stats Feb 10, 2025
@Erd89
Copy link

Erd89 commented Feb 10, 2025

Same problem on macBook m2pro with only the network sensor active.

@mathieufrh
Copy link

I am on MacBook Pro M4 and can confirm Stats is using about 500 GB of RAM, which is insane and not usual.

@exelban exelban changed the title Memory leaks on apple chip device Huge memory usage Feb 10, 2025
@exelban
Copy link
Owner

exelban commented Feb 10, 2025

I find the problem, it's not a memory leak. I have add a stress tests for CPU and GPU to the app. And GPU class allocate a memory at start, and it's just takes a lots of RAM on init.

Will be fixed today/tomorrow.

stats/Kit/helpers.swift

Lines 1749 to 1756 in 706a996

self.bufferA = device.makeBuffer(length: self.dataSize * MemoryLayout<Float>.size, options: .storageModeShared)!
self.bufferB = device.makeBuffer(length: self.dataSize * MemoryLayout<Float>.size, options: .storageModeShared)!
self.bufferC = device.makeBuffer(length: self.dataSize * MemoryLayout<Float>.size, options: .storageModeShared)!
let dataA = [Float](repeating: 1.0, count: self.dataSize)
let dataB = [Float](repeating: 2.0, count: self.dataSize)
memcpy(self.bufferA.contents(), dataA, dataA.count * MemoryLayout<Float>.size)
memcpy(self.bufferB.contents(), dataB, dataB.count * MemoryLayout<Float>.size)

@exelban exelban moved this from Todo to Ready to deploy in Stats Feb 11, 2025
@Reflex-Gravity
Copy link

@exelban When is this planned for release?

@exelban
Copy link
Owner

exelban commented Feb 14, 2025

as usual, Sunday

@exelban exelban closed this as completed Feb 16, 2025
@github-project-automation github-project-automation bot moved this from Ready to deploy to Done in Stats Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need to be fixed Need to be fixed
Projects
Status: Done
Development

No branches or pull requests

5 participants