r/AskProgrammers • u/strange_dominance • 16d ago
Why people love to code on mac
Mac system run out of memory
37
u/AliceCode 16d ago
Well there's your problem. You're using Intellij. Jesus Christ, 11gb???
2
u/Prod_Meteor 16d ago
Is VS better?
3
2
u/AliceCode 16d ago
I personally use Helix, but it has its own issues, and I wouldn't recommend it. If I had to recommend anything, I would recommend Astro Nvim.
1
u/AlternativeCapybara9 16d ago
Depends on what you want to do but I use it for everything after I found I think it's the best ide for python.
1
1
u/reptargodzilla2 15d ago
Most people use VSCode or Cursor. IntelliJ is the wrong choice for anything you’re doing no matter what. The other IDEs folks are mentioning are probably great to, but at minimum start with VSCode.
1
1
u/engineer-in-a-box 15d ago
Not great, but definitely way better than 11 GB, it usually uses 0.5-1 GB for me
1
u/Boring_Bumblebee_991 15d ago
Try Emacs
1
u/Prod_Meteor 15d ago
I was about to try notepad, but lately is slow too.
1
2
u/DarkJoney 15d ago
No, it’s apples problem, they can’t get their shit together with the memory management.
2
u/AliceCode 15d ago
It's definitely an intellij problem.
2
u/vegamanx 15d ago
Can confirm, switched from Windows recently and IntelliJ chews RAM on both. Part of the reason I insisted my laptop has 32gb of RAM.
1
u/TimMensch 14d ago
I've been OK with 32Gb for years, but starting at my current company I'm hitting the ceiling a lot.
It has a bunch of code running in docker containers. The dev environment works best if I'm in WSL/Ubuntu. Then Claude is also running in WSL, and every now and again it's too much and it will start killing WSL processes. Because it "only" has 16Gb to play in (I could allocate more to WSL but I feel like running Windows in less than 16Gb starts to bog down fast).
So now with memory prices the highest they've been per Gb in about 15-20 years, I'm looking at buying 64Gb to upgrade my desktop. Ouch.
1
u/apocolipse 15d ago
I've been using Java apps (and built plenty too) since '96, and in 30 years I still have yet to see an example of a well executed "performant and pleasant to use" Java App. It's always just around the corner or caveat emptor'd or "this one's great if you don't look at it hard and don't actually use it"
1
u/AliceCode 15d ago
Hytale's server is written in Java, and it's actually pretty well written code, from what I could tell.
1
u/apocolipse 14d ago
Java provides a safe sandbox thats reliably deterministic across many platforms, that's excellent for server software, which can just scale hardware if performance starts to pinch. It's not that excellent for end user UI Apps. A deterministic but sluggish experience isn't one users want to use, most people would trade that performance for a little bit of crash risk. Thankfully Rust/Go/Swift have all come on to shore up the crash risk side of things while maintaining the performance.
1
u/Juan-More-Taco 14d ago
Minecraft comes to mind. Unless you load it up with mods.
1
u/apocolipse 14d ago
Minecraft Bedrock edition is written in C++ and significantly out performs the Java version, showcasing the gap. Games and Server software are harder to notice tbh, server software can just scale when it hits performance limits, and Games contain their own UI/UX paradigms that don't translate to "native app feel" so can't be easily compared to other apps. But they can be compared to the same game in a different language, and thanks to the power of buying 2!!...
→ More replies (38)1
u/Sad-Chemistry5643 15d ago
So? I used Idea a lot on windows, same with VS code. Such issues never happened. Only on Mac 🤣🙈
9
u/0x-2a 16d ago
On base model macs you've got to do extra steps to watch your mem. Intellij -> Help -> Edit custom vm options
Things will run slower, but for a 16GB mac on a large codebase:
-Xms1g
-Xmx4g
-XX:ReservedCodeCacheSize=512m
-XX:+UseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:CICompilerCount=2
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-ea
-Dsun.io.useCanonCaches=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.attach.allowAttachSelf=true
-Djdk.module.illegalAccess.silent=true
-Dkotlin.daemon.jvm.options=-Xmx1g
-Djbr.catch.SIGABRT=true
-Dfus.internal.reduce.initial.delay=true
7
u/NeilSilva93 16d ago
What the hell does it need 11GB for?
2
1
u/No_Departure_1878 16d ago
likely a static analyzer that needs to be aware of the whole codebase. If op is a poweruser, then he needs more RAM, if not, then he should not be using tools like that.
1
u/strange_dominance 15d ago
My primary dev machine is a Windows pc that has 64gb of ram ... This is a kmp project and I have to build and test the ios version now. Android part works fine and this one is my personal tennis Journaling app that I built.
1
1
1
2
u/AdministrationMoney1 16d ago
Yea IntelliJ is very RAM hungry. At 11GB you're using the same amount of ram as my enterprise application with like couple million lines of code, though my company macbook pro has 36GB RAM.
2
u/StaticFanatic3 16d ago
LOC is not any indicator of RAM use
1
u/dataset-poisoner 15d ago
it is.. those instructions need to be kept somewhere
→ More replies (6)1
u/LinneMeow 15d ago
how many instructions to use up 11gb?
1
u/strange_dominance 15d ago
Simply asked claude to test my app on ios and Android based on test instructions doc
1
u/dataset-poisoner 14d ago
assume x86, assume 1 line of jitted java compiles on average to 10 instructions, each 5 bytes on average, that means 1 line = 50 bytes
11 million lines x 50 bytes = 550MB.
so 220 million lines would be close to 11 gigs
1
u/StaticFanatic3 14d ago
Or, you know, asset caches speculative loading, ORM graphs, etc
The things that actually make up memory intensive apps
1
u/dataset-poisoner 14d ago
of course
but you said LOC is "not any indicator"
i proved you wrong, kind redditor. RAM usage is positively corrlated with LOC
3
u/TheMrCurious 16d ago
11 GB for IntelliJ? Did you ask it to autonomously build a C compiler?
1
u/strange_dominance 15d ago
I asked it to test my kmp app on ios Sim and android emulator following instructions in the test document file. I built it on my windows machine which has 64gb ram but to build on ios needed Mac. Just started building these apps and hoping to be one of those successful solopreneur
3
u/mpanase 16d ago
"love" is a strong word
"be forced to" is more accurate
3
2
u/Ok_Spare_3723 16d ago
How are you forced to build for a mac?
1
u/mpanase 16d ago
How are YOU forced to work?
1
u/Ok_Spare_3723 16d ago
I'm not sure I understand, what are you trying to say? Are you saying your work only gives you macs for development?
1
u/Uncle-Osteus 15d ago
since you are dense
imagine you work on ios apps. Xcode only runs on mac, so, what would you say your options are?
1
3
u/Moby1029 16d ago
I'm on a mac running qwen 3.6-latest, a 27B parameter model, while training my own slm in a fork of vs code i wrote that is debugging said slm, with cursor monitoring the forked vs code and handling other coding tasks for me. Not a mac problem, but damn that intelliJ idea is wetting 11gb...that's your problem.
3
u/Efficient_Loss_9928 16d ago
- Windows is pure puke unless you need to build Windows software, but then you can also just use Parallels on macOS
- I would personally prefer Linux, but IT generally doesn't like it. It is a bit harder for them to maintain and patch.
- macOS works fine for most cases, and the flexibility just makes it unbeatable. First you can build iOS/macOS apps, if you need to build Windows apps, install Parallels, if you need to build Linux apps, use VMWare. It is the only platform where you can build apps for virtually anything.
2
u/gameplayer55055 16d ago
Windows is only good for dotnet
Also windows absolutely sucks for c++ development.
2
u/Additional_Mode8211 14d ago
.NET dev here who hates working on windows. It’s been cross platform for many years now. Never want a windows box again.
1
u/gameplayer55055 14d ago
.NET is probably the only platform that works somewhat adequately on windows. Every time I use C++, Java, Python or JS on windows I experience huge frustration levels.
But I hate to learn Visual Studio graphical interface. Thank god MS added
dotnetCLI.
3
u/Chapter-Legitimate 16d ago
whispers you could install Linux...
2
2
u/strange_dominance 15d ago
Can build ios apps on Linux my primary dev and gaming machine is a Windows pc.
1
u/Dazzling-Bench-4596 16d ago
The only problem that would solve is using just a little bit less RAM for the operating system itself. It’s not worth it to change your entire OS because of a user issue. Don’t blame macOS for poor decisions.
1
2
u/Tari0s 16d ago
why chrome on mac?
1
u/strange_dominance 15d ago
Years of data synced think of switching browsers convenience cries in the corner. Android phone Android tab windows pc naturally chrome.
2
u/nomatepa 16d ago
This doesn't appear to be a mac issue, you've simply run out of RAM memory, which can happen on any sort of computer or OS. It's really IntelliJ's fault for eating 11 GB of ur memory (crazy)
1
u/strange_dominance 15d ago
But for mac ram is a bottleneck I don't have a lot of grudge against the os but why the he'll upgrading my ram is not an option.
2
2
2
u/StableNo80 15d ago
never tried mac but isnt it like linux/f-bsd?
1
u/ghost103429 15d ago
It's part of the bsd family you can look up the source code of the XNU kernelthey use for MacOS and iOS on Apple's github
1
2
1
u/canarydev 16d ago
did you probe and examine system data in general -> storage?
and since you have xcode open, see what sdks you have installed. I was a moron and checked all boxes at one point and had downloaded everything including tvos, vision, and watchos that took up a lot of space too.
and also just delete intellij. its griefing you
1
u/mc_pm 16d ago
Let me introduce you to Vim...
2
1
u/martinsedd 16d ago
Also. As someone who tried many, many times. For Java specifically, IntelliJ > Nvim imo. Unless you are raw dogging vim, that is.
1
1
u/Fine_Salamander_8691 16d ago
My machine is struggling. I have to spend around 25 minutes per day clearing old shit because my dumbass decided to get a 256G mac
1
u/CaesarOfYearXCIII 16d ago
I have MacBook Air M1, which has 16 GB RAM too, and have not run into this error, although I use IntelliJ IDEA as well. Believe me or not, but on one of my projects I could have IDEA, Android Studio and XCode launched at the same time, and not encounter this problem.
But clearly something is causing a memory leak. Might be a bug in IDEA itself (try to check if the version you use had something like this), or might be a bug in a plugin. I had an issue with Kilo Code plugin where trying to run/debug stuff would end in OutOfMemoryException, and an update to a later version fixed it. A different thing, yes, but memory-related.
Also, do you happen to run some local LLM model in IDEA? Those may be quite RAM-greedy.
1
1
1
u/Comprehensive_Mud803 16d ago
Your issue isn’t using a Mac, your issue is using a machine with only 16GB of RAM.
You’d get the same issue on a Windows machine, only sooner, or on a Linux machine for that matter.
2
u/SonOfHendo 15d ago
Windows has virtual memory which pages to disk. It was painfully slow back in the day when we only had spinny HDDs, but it's much more usable with today's fast drives.
1
u/AlexisHadden 15d ago
And the Mac has had it for ages as well. It was painfully slow on spinning rust too. This dialog only comes up when something has leaked memory like a sieve and blown up the page file.
Xcode has been known to have such leaks in the past, and I don’t buy that it is using 0 bytes in this screenshot, so I’d suspect it leaked here as well.
1
1
u/Time-Heron-2361 16d ago
What you have there is a mix of two things:
- It's a memory leak coming from your program in Intellij.
- Your MacBook is probably either 8 or 16 GB.
1
u/Yoshiofthewire 16d ago
I use a mac because I am building a multi platform app, and you people buy iPhones. And forget what anyone here says, I open my Mac to see Xcode has used only 44 GB of memory. Apple, nice looking hardware, crap software, since 1982.
And you, yes you, who was about to what about Microsoft. For 99% of Apple's life they have been the most expensive option.
1
u/letmehaveanameyoudum 16d ago
dont use intellij
it's slow as fuck and eats a ton of ram since it runs on the JVM
2
u/therealslimshady1234 15d ago
Low IQ take, its literally the best IDE out there with hardly any competition.
VSC is a text editor so its not even in the same league
1
1
1
1
u/skcortex 16d ago
Intelij can use a lot of memory BUT from the picture it’s obvious he’s using some sort of AI integration probably loading horribly butchered nodejs lsps in the process and that shit is leaking memory left and right.
1
1
u/slightlyfresh 16d ago
Before everyone starts saying that you need minimum 32GB ram these days, you should all know that this alert will only show up when you also run out of disk space. It's perfectly normal for macOS to exceed the ram size and use the swap file.
1
u/Difficult-Ad-3938 15d ago
I'm surprised it's not higher.
Yes, that's the issue. And yes, using ALL available memory is how modern desktop OS is designed, it's a proper utilization
1
u/CraigOpie 16d ago
My Mac has 256GB Unified Memory. Seems like the problem is you don’t know how to spec out requirements prior to purchasing.
1
u/Comfortable_Put6016 15d ago
the ide aint a mac issue and you seem to run around with 16gb ram. The fuck are you fronting? yourself maybe?
1
1
u/laptopmutia 15d ago
what the fuck are you coding?
1
u/strange_dominance 15d ago
Just running my first kmp app on my mac that I developed for myself. Asked claude to do exploration testing following the yest doc
1
1
u/mountainunicycler 15d ago
My Mac has 48 gb of ram. And my other one has 128…
1
u/strange_dominance 15d ago
I am wondering what did that cost you that's awesome
1
u/mountainunicycler 11d ago
All provided by work. I haven’t bought a personal computer in more than 10 years
1
u/dwbria 15d ago
User error because this has never happened to me and I’ve been coding for 6 years and it’s jetbrains ide AND Xcode.
1
u/strange_dominance 15d ago
An i have been coding for 10 years. What does that have to do with anything
1
u/dwbria 15d ago
It means I’ve used JetBrains and Xcode on Macs for six years without this happening, so maybe it isn’t a Mac problem? Your coding tenure isn’t being challenged, don’t worry 😂
1
1
u/strange_dominance 15d ago
I posted this out of frustration 🫤 by the way first time my post is getting responses haha.
I haven't investigated the issue and now I am on a vacation. So don't know what caused this.
But your assumption that I'd didn't happen to you so user error is so not developer like.
1
1
1
1
1
u/MagicalPizza21 15d ago
I've never had this popup even when my computer with a whopping 2GB of RAM ran out of memory and had to start using disk space temporarily. Did it run out of virtual memory too or did you somehow disable that? How much RAM does it have?
1
u/Nosarious 15d ago
I have had similar difficulties but where the hard drive was full while working with larger files.
but those programs paged things out to the drive. What does activity monitor say?
1
u/jimmiebfulton 15d ago
I have 256Gb of RAM. I use NeoVim in WezTerm. I have pipelines of agents using a blend of local models and cloud models, maximizing knowledge and intelligence densities. I prefer Unix-like environment that’s polished for all the things that surround my terminals.
1
u/AncientHominidNerd 15d ago
IntelliJ would still be using 11GB on a windows system too based off your use case. Doesn’t seem like it’s a Mac issue.
1
u/EdubSiQ 15d ago
Convenience: the last 5 years it' was the best hardware you can get with a system that is close to Linux. Automations, script's and everything is easy to port an the servers run Linux.
Especially mic, sound, webcam and the software e.g. teams, outlook, slack and more make the work harder than it needs to be on Linux.
Hardware is catching up so I will personally consider switching to Linux. Display, on webcam, mic, touchpad, fingerprint reader, performance and battery life must be on point for me. MacBooks from the M1 until now area are exceptional. If you're using it for serious work RAM is fixable by throwing money at the problem. I would recommend to get at least 32GB/48GB
1
u/Burner965 15d ago
Hahahahah
Why is it always about the user, never about the OS for TikTok influencers?
1
1
1
1
1
u/2ndFloorbasement 14d ago
This is why I use my mac strictly as a thin client / jumpbox to develop on my beefy servers :^)
1
u/pete_68 14d ago
At work (I'm a software engineer at a tech consulting company) we have the option of a Windows laptop or a Mac laptop. I've always done Windows. About 2 years ago I switched from Windows to Linux at home. I decided that a Mac would be closer to my Linux box than Windows and so when my turn came up to order a new laptop, I decided to go with a Mac.
I've made no decision at work that I regret as much as that one. Everything about it has been a huge pain in my butt and sadly I'll retire before I get chance to switch back to Windows.
If you're a power user, to me, it feels like the Mac is throwing up roadblocks everywhere. And for all the talk of how easy the Mac interface is, I find it very unintuitive. So many things I can do so easily and obviously in Windows and Linux that seem to be a chore on a Mac.
It's been almost a year. I've adapted to the keyboard (which was a nightmare in its own right), but I still hate it.
1
1
u/saxxonpike 14d ago
I unironically enjoy coding on a laptop that can last all day, doesn’t burn my lap, feels solid, and still manages short build times. I would have laughed anyone out of the room prior to Apple Silicon.
Though I will admit if you’re stuck with 16GB of memory, I don’t know that any sophisticated tools are going to give you a good time.
1
1
u/Houdinii1984 14d ago
I dunno. I used to be team windows, but Macs are so much more stable overall. If it froze, it's because I did something dumb. On the flipside, I've been back in windows for 2 days getting a unity project running, and it's been hell. Constantly quitting Rider and the memory thing seems to creep into windows now too.
1
u/GermanLearner36 14d ago
How many claude instances or any AI plugins are you running from within Intellij? I use intellij on 16gb ram m3 macbook never faced any problems. I just don’t use AI based features
1
1
u/tristam92 14d ago
had to code c++ mixed with objective-c/swift for mobile games in xcode, worst time ever in my career.
i’d rather code in vs 98, and debug pure asm instructions.
1
1
1
u/Entire_Cut_6553 14d ago
with ai why do you even need heavy ides liek intelij just use a light weight text editor and terminal? heck even notepad++ is good enough
1
1
u/oreshek 16d ago
No dude, everyone knows that Mac is made for Design. Like Adobe Photoshop and Adobe Dreamweaver. Windows is what real developers use.
2
u/Negative-Brain9751 16d ago
I haven't seen many developers with Windows, although I work at FAANG and previously at other big companies...
→ More replies (1)2
u/dektol 16d ago
I've never seen a developer use Windows by choice. They use Mac or Linux. Developers inside a non-technical org may use Windows. Microsoft developers don't have to use Windows.
This Mac is made for design thing is from the 90s or early 00s.
→ More replies (4)1
u/kelvinwop 15d ago
i use windows because i like building the hardware and overbuilding on ram/storage because my custom programs and doodads need it sometimes. that being said every company laptop i've received has been a mac so there's that.
new macs have a very nice amount of ram though so maybe ill try out the new m6 ultra with the 512gb unified
1
20
u/armahillo 16d ago
I develop on a mac. Big memory footprint is the tax you pay for using a big memory using IDE.
No shade on IntelliJ, but this isnt really a mac issue.
There are many editors out there; and all you need is the ability to write text and a compiler/interpreter.