GithubHelp home page GithubHelp logo

Comments (4)

godbout avatar godbout commented on August 29, 2024 1

i can die peacefully in my sleep now \o/

thanks again for your time.

from keyboard.

creasty avatar creasty commented on August 29, 2024

I hate to break it to you but I'm no expert either. This has been the first and only macOS app I've ever created so far.
Perhaps, the simplest reason as to why passRetained being used here is that I found an implementation that used passRetained and I didn't give it much thought...

For what it’s worth, I have never had a memory issue — Consumption-wise, it only uses 15MB at a startup and a week later.
So I assume it might not be critical if we use passRetained or somehow it releases memory at some point. 🤷‍♂️

Anyway, now that you've mentioned it, I've tested both versions and examined the memory usage.
The below are the result of Instruments where I waited 10 sec after the startup, pressed as many random keys as possible for 30 sec, and waited another 20 sec to stop.

passUnretained

Screen Shot 2020-12-20 at 17 34 46

passRetained

Screen Shot 2020-12-20 at 17 36 40

Screen Shot 2020-12-20 at 17 39 24

You're right, there were actually memory leaks.
Wonder how it hasn't been a problem for me...

from keyboard.

godbout avatar godbout commented on August 29, 2024

ah. thanks for taking the time. and sorry, i meant no macOS/iOS/Swift/Objective-C development here.

i've heard about Instruments but haven't open it yet. seems another big chunk of time and exploration needed to understand that one correctly too. but i'm confused—again—now with your screenshots. i would have expected the leaks to appear on the passRetained one rather than the passUnretained? actually, if passRetained doesn't show any leak, i would have expected passUnretained to simply crash. so, am i misunderstanding how Instruments is reporting leaks?

btw. thanks for making this repo public. inspiring, beautiful code.

from keyboard.

creasty avatar creasty commented on August 29, 2024

but i'm confused—again—now with your screenshots. i would have expected the leaks to appear on the passRetained one rather than the passUnretained?

Oh, shoot. It was the other way around. Swapped the titles.

btw. thanks for making this repo public. inspiring, beautiful code.

My pleasure.

from keyboard.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.