News for hackers. Stuff that matters.
Re:Apple Silicon M1: A Developer's Perspective by Toutouxc on Saturday November 28, 2020 @01:00PM (#25239153)
I don't know. I did what I'm currently doing (Ruby on Rails dev) on a 4 GB MacBook Pro until last year and it was fine.

At the moment I have around 2 GB free on my 8 GB Linux machine with a webserver, MariaDB, a JetBrains IDE, Slack and Firefox running. It would be easy and dirt cheap to increase the RAM to 16 or 32 GB but I'm too lazy to even order it and open the machine up since I have never felt the need to have more.

I'm just saying this so that people like me remember that they're still professionals and their work is valuable even if they don't need 64 GB of RAM.

Re:Apple Silicon M1: A Developer's Perspective by lumost on Saturday November 28, 2020 @01:06PM (#25239203)
IDEs such as IntelliJ can easily consume 8GB of memory on a moderately sized project of 100k loc. If one has to open multiple such projects or work on a very large project in the million loc scope then you’ll run out of 16 GB really fast.

Folks working with data intensive applications often need to trade off writing code to page data in and out of memory during development with larger dev boxes.

Re:Apple Silicon M1: A Developer's Perspective by Jtsummers on Saturday November 28, 2020 @01:43PM (#25239516)
100k LOC would be, let's be generous, about 8 million characters (80/line average, which is high). 8GB of RAM for 8MB of input seems excessive to me. What's going on with that IDE that it needs so much for something so small? Even if that were 8 million distinct tokens/symbols in the input, that's still 1KB/token of memory consumed.
Re:Apple Silicon M1: A Developer's Perspective by CapsAdmin on Saturday November 28, 2020 @01:57PM (#25239613)
I would assume code analysis.

8gb still sounds a bit excessive but given how long java stack traces can be maybe it's not so strange.

Re:Apple Silicon M1: A Developer's Perspective by aledalgrande on Saturday November 28, 2020 @07:14PM (#25241763)
Except that is only what an IDE does at the very minimum. An IDE loads plugins, provides intellisense, documentation, potentially loads documentation of all the libraries, watches files, displays Git status, parses your code for syntax highlighting etc. etc.

You're not opening a TXT file with 100K lines in it.

Re:Apple Silicon M1: A Developer's Perspective by z3t4 on Saturday November 28, 2020 @03:14PM (#25240155)
For every key stroke a new immutable string is created with the content of the file/state. Plus data structure for AST/static analysis of every file in the project including dependencies. Plus another copy of the file for rendering with syntax highlight. One would think all this copying of data is very inefficient, but computers are good at moving data around. The most costly is rendering the glyphs.
Re:Apple Silicon M1: A Developer's Perspective by wulfklaue on Sunday November 29, 2020 @09:17PM (#25250114)
> IDEs such as IntelliJ can easily consume 8GB of memory

Sound more like a Jetbrain ( IntelliJ company ) problem. Used to develop on PHPstorm ( another Jetbrain ) product ( same software in the background ) and the slow startup's, 2GB+ memory eating for relative small projects, crashes way too much, expensive as hell for what it does ( especially with the license change years ago ) ...

Eventually switched to Visual Studio Code and while people whine how Electron is memory inefficient, its like 1/6 the memory usage of PHPstorm, with only a few features missing.

Even on a 32GB PC system, i barely use 16GB ( and WSL2 is eating up a lot with a lot of docker images. And its not really docker, just Linux cache eating up memory ). Not a issue on a Mac that does not need a VM like layer.

Its about priorities sometimes. If people keep upgrading their memory, developers/companies simply push the responsibility to the clients and do not bother with spending time on optimizing.

If people start leaving software product on the way side for being just horrible inefficient messes, then maybe a bit of focus will come back to actually optimizing products! You will see Jetbrain change tune, when VSC etc keep eating its market share.

Re:Apple Silicon M1: A Developer's Perspective by fayten on Saturday November 28, 2020 @06:18PM (#25241419)
I have worked on a large 10 year old Spring application with well over 300k loc for 3 years. I don't recall Intelij ever exceeding 3gb of ram. Intelij reminded snappy on my Macbook Pro 2015 with 16gb of ram and an i7.
Re:Apple Silicon M1: A Developer's Perspective by CapriciousCptl on Saturday November 28, 2020 @03:01PM (#25240048)
Same experience here. My Ubuntu laptop accidentally doubled-down on 16gb RAM because I forgot to give it a swap partition (whoops). It hangs maybe once a month under a VS Code, PostgreSQL, FastAPI/Python, React workload. Basically, not annoyingly frequently enough for a lazy person like me to change the partition table. The same workload on my 7 year old Ubuntu desktop with a swap partition on a fast SSD very rarely ever hangs.

Certainly some devs need more than 16gb, but they know who they are. And you know who they are because, well, they love telling you :).

Re:Apple Silicon M1: A Developer's Perspective by CraigJPerry on Saturday November 28, 2020 @03:55PM (#25240464)
You could create a swap file rather than a dedicated partition:

    $ dd if=/dev/zero of=/swap bs=1M count=8192
    $ mkswap /swap
    $ swapon /swap
    $ echo "/swap swap swap defaults 0 0" >> /etc/fstab
Re:Apple Silicon M1: A Developer's Perspective by laurencerowe on Saturday November 28, 2020 @05:35PM (#25241131)
You don’t need to reparation, just configure it to use a swap file. If you set swappiness to zero it will only use it when out of ram.
Re:Apple Silicon M1: A Developer's Perspective by barkingcat on Saturday November 28, 2020 @04:39PM (#25240790)
you can always add a swap file ... that makes your life easier so you don't have hangs, and you don't need to repartition.

I use swap files all the time with things like raspberry pi's and such because I don't want to mess with the sd card partitions, but still from time to time it's good to have that swap fallback since the memory onboard is limited.

Swap files are super easy to set up, take up no "brainpower" and disk space is cheap these days.

Re:Apple Silicon M1: A Developer's Perspective by matwood on Saturday November 28, 2020 @01:49PM (#25239552)
I think it really depends on if your development workflow requires VMs/Docker or not. It seems crazy to me to have a bunch of containers running using 4-8gb each, but for many that is how they develop.
Re:Apple Silicon M1: A Developer's Perspective by e12e on Saturday November 28, 2020 @01:29PM (#25239407)
Curious - why intellij for ruby on rails? (I'm quite happy with (neo) vim (qt) and a slew of (mostly) tpope's plug-ins.
Re:Apple Silicon M1: A Developer's Perspective by leipert on Saturday November 28, 2020 @03:26PM (#25240236)
Not GP, but RubyMine (the Ruby IDE from JetBrains) has decent support for refactoring things, type interference, executing single tests with a debugger, etc.
Re:Apple Silicon M1: A Developer's Perspective by notreallytrue on Saturday November 28, 2020 @01:11PM (#25239239)
The system is swapping a lot but the SSD is giving you the impression that 8GB are enough
Re:Apple Silicon M1: A Developer's Perspective by Wowfunhappy on Saturday November 28, 2020 @01:24PM (#25239358)
> but the SSD is giving you the impression that 8GB are enough

If it works, is it impression or reality?

Re:Apple Silicon M1: A Developer's Perspective by robgibbons on Saturday November 28, 2020 @01:45PM (#25239528)
Swap isn't great for SSD lifespan. Probably not a drastic loss, but nonetheless not helping its longevity.
Re:Apple Silicon M1: A Developer's Perspective by notreallytrue on Saturday November 28, 2020 @01:46PM (#25239532)
Impression is in the realm of reality, it's simply deceptive

Jetbrains that fits in 8GB of memory with slack and Firefox leaving 2GB free it's not happening

I used to code on 800×600 monitors professionally

If I say today that they are more than enough to work, I expect to be taken to a mental institution

Re:Apple Silicon M1: A Developer's Perspective by spyridonas on Saturday November 28, 2020 @02:55PM (#25240002)
Until the SSD dies. It's recommend to disable swap if you have an ssd