Are 8 GB RAM enough for programming?

Discussion in 'Buying Tips and Advice' started by iMacedonian, Dec 15, 2018.

  1. iMacedonian macrumors member

    iMacedonian

    Joined:
    Oct 10, 2015
    Location:
    Skopje, North Macedonia
    #1
    Hey there.

    I am seriously considering getting a MacBook Pro 13" 2018. The primary use of the laptop would be for coding (front-end web development) but I'd like to dive in into iOS app development later on. With that said, are 8 GB of RAM enough to run XCODE or I should invest some more to get the 16 GB version?
     
  2. revmacian macrumors 6502

    revmacian

    Joined:
    Oct 20, 2018
    Location:
    USA
    #2
    I run Xcode on my 2014 Mac mini - it has 4GB RAM and I don't see any problems. There will be some people who will tell you that 16GB or more RAM is a must, but I have seen that this simply isn't true.
     
  3. Emanuel Rodriguez, Dec 15, 2018
    Last edited: Dec 15, 2018

    Emanuel Rodriguez macrumors member

    Emanuel Rodriguez

    Joined:
    Oct 17, 2018
    #3
    Agreed. I've found that even a Raspberry Pi with its single gig of RAM is capable of compiling most things. If a project has a ton of C++ code (looking at you LLVM), or other complex languages (requiring the compiler to work hard, and thus use more RAM), then it generally can't manage it. Seems around 3GB is a safe minimum for development work, in my experience.

    EDIT: Although keep in mind that this was 3GB inside a VM, without a GUI. The 8GB option is definitely safe, for now. I'd recommend 16GB just for future-proofing though. 8GB is starting to become less comfortable than in times past.
     
  4. ammulder macrumors newbie

    Joined:
    Dec 18, 2015
    #4
    How long are you planning to keep the machine? Since the memory can't be upgraded, you're really buying for how much memory you'll need in 3-5 years, not today. (Bearing in mind that every release of development tools uses more memory than the last.) Particularly if you end up using containers or VMs (e.g. to run a local version of some back-end that your app connects to), the productivity hit of too little memory later is not worth the cost savings now.
     
  5. dogslobber macrumors 68040

    dogslobber

    Joined:
    Oct 19, 2014
    Location:
    Apple Campus, Cupertino CA
  6. 960design macrumors 68030

    Joined:
    Apr 17, 2012
    Location:
    Destin, FL
    #6
    8GB is plenty, I use a 16GB MBPr and rarely see the memory pressure jump above 8GB.

    As an aside, check into Expo.io ( https://expo.io/ ). It is what all the cool kids use these days ( so much easier to deploy on multiple platforms ). Caveat: will work for most apps, but some have specific hardware requirements / needs that expo will not fulfill. Nonetheless a fantastic starting place.
     
  7. jtara macrumors 68000

    Joined:
    Mar 23, 2009
    #7
    Define what you mean by "enough"?

    Do you mean "enough so that builds don't fail?"

    Or "enough so that builds complete in an acceptable timeframe"?

    And/or "enough so that the UI isn't laggy, and I can work in an editor/browse the web/read email during a build without sluggishness?

    It depends on your expectations and your toolchain.

    Frontend development typically has a short/simple toolchain. All you really need is a good editor suitable for the task, some little "toy" web server, perhaps some tools for minifying Javascript/CSS (and perhaps a Sass compiler) for production builds, and during development you typically wouldn't even use that.

    Backend development might often need no more than front-end development. Or might need quite a bit more. For example, I use PostgreSQL as a database. So, I have a local instance for development/test. I run pgAdmin4, which runs in a Docker container. You might need to run a VM that replicates your backend environment. The GB add up.

    Native app development is often done with minimal tools. For basic iOS app development, you need nothing more than Xcode. OK, and the iOS simulator. If you are doing some sort of hybrid, cross-platform development, probably add additional toolchain components - and of necessity Android SDKs and build tools. Android development uses a different compiler. Add another simulator. (I use GenyMotion, since both approaches provided by Google are slow as molasses.) Any decent Android simulator runs in a VM.

    Oh, need to test that website on Windows? Add a Windows VM.

    So many tools today run in a container or a VM. That adds to memory requirement.

    Get as much memory as your budget can stand. I think, though, 64GB is the practical bound today for most development. I recently got an iMac Pro with 64GB for development. I use a big tool set. I've been checking Activity Monitor, and I find that I haven't used a swap file yet. But once all the tools are loaded up, I am using somewhere between 32GB and 64GB, typically 40-50GB. But I actually haven't had EVERYTHING loaded up at once yet.

    What you have to ask yourself is:

    - Is it important for the system to be responsive while building?
    - How long of a build cycle are you willing to tolerate?

    In front end development, you typically do not have a "build cycle", that is, build/test/repeat. How long are you willing to wait to find out you made a simple mistake that will take a few seconds to correct? 15 minutes? 5 minutes? 1 minute? 30 seconds?

    In app development using a compiled language, you always have a build cycle, and it can be significant. I understand that the Swift build cycle is substantially longer than the Objective-C build cycle. (I don't use Swift myself, because I do hybrid development, and the underlying platform code is in Objective-C (Java for Android), C, and C++ - no Swift).

    Amount of available RAM will have a significant impact of build cycle time.
     
  8. mpe macrumors 6502

    Joined:
    Sep 3, 2010
    #8
    32GB iMac Pro user here.

    Yes. 8GB RAM is enough for most things.
     
  9. jtara macrumors 68000

    Joined:
    Mar 23, 2009
    #9
    Does MacBook Pro use system memory for the display?

    8GB surely is not enough on - for example - a Mac Mini, as a pretty good chunk (depending on model) of that is used for the display.

    Most important feedback given here is that on recent MacBooks, memory is soldered down. You are making a decision for the next several years.
     
  10. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #10
    If you're on a budget (and there's no shame in that), 8 gigs will be enough. While some development tools are pretty RAM-heavy (*cough* Android Studio *cough*), my 4 gig 2013 Pro is still usable. And my work-issued ThinkPad that I do Rails development on (in RubyMine, in Linux) works like a charm with 8 gigs.
     
  11. iMacedonian thread starter macrumors member

    iMacedonian

    Joined:
    Oct 10, 2015
    Location:
    Skopje, North Macedonia
    #11
    Thanks for that extensive response, it gave me a better perspective on the resources needed for these various coding scenarios you've mentioned.
    --- Post Merged, Dec 17, 2018 ---
    My laptops usually last 4-6 years, or even more, so based on what I've read so far, maybe it'd be best to get the 16 GB version if I want to maximize the usage.
     
  12. Anony-mouse macrumors newbie

    Joined:
    Aug 25, 2016
    #12
    This pretty much sums it up. If you need to run VMs, then 8 GB is doable (you can run one VM comfortably in 8 GB RAM). If you have a SSD, the speed difference between having 8 GB vs. more RAM will not be very obvious unless you're running a large number of VMs and/or trying to compile a huge codebase.
     
  13. Construct macrumors newbie

    Joined:
    Jun 23, 2010
    #13
    The difference between an 8GB machine and a 16GB machine is that you will, at times, have to make conscious decisions about which memory-hungry apps to keep in the foreground.

    Memory hungry apps like XCode and Android Studio will do just fine in 8GB. The problem would come if you tried to run Slack connected to multiple groups, while leaving Chrome open with numerous tabs, or maybe a VM system to run some Docker containers. It's the concurrency that causes the problems.

    If you can afford the jump to 16GB and you plan to keep this machine for a while, I think it's entirely worth it for the future-proofing. If the extra cost is enough to make you think twice, then forget about it and just do 8GB. You'll be happy either way.
     
  14. revmacian macrumors 6502

    revmacian

    Joined:
    Oct 20, 2018
    Location:
    USA
    #14
    As I stated earlier, I run Xcode on my 2014 Mac mini - it has 4GB RAM and I don't see any problems. If I can code comfortably with 4GB, then 8GB is plenty.
     
  15. jtara macrumors 68000

    Joined:
    Mar 23, 2009
    #15
    Or you could just speed up the compile-link-run cycle to the point where it takes no more than a healthy get-your-butt-out-of-the-chair for a couple of minutes.

    One part of that is having enough memory for the compiler to work efficiently, with minimal/no swapping.

    That you CAN doesn't mean that you SHOULD. You have to decide how valuable your time is.

    The defining moment for this equation for me was many, many years ago. A product called Instant-C. It reduced that cycle from several minutes to several seconds. It inspired me to reduce a compile-link-run cycle for an application that simulates and analyzes variations (from a model, originally written in Fortran) in mechanical assemblies from 1/2 hour to less than a minute. (OK, I cheated - I removed the compile-link-run cycle... by writing a domain-specific compiler and companion bytecode interpreter) 35 years later, it's still the predominant solution for that domain.

    Anyway, OP made his decision - I think a wise one.

    BTW, were I still using my 2012 i7 Mini for builds, I would employ a Ramdisk. It approximately halves build time for me on the Mini. I tried it on my new iMac Pro, but did not have the same impact. I'm afraid I didn't think to try the ramdisk until I got the iMac Pro. MacOS doesn't really have great RamDisk solutions. The Mini has 16GB. There's no margin for a ramdisk on a machine with 4GB. (The iMac Pro has 64GB).
     

Share This Page