How much of a memory impact do tabs in my terminal have?

When I am running my dev server, the log lines add up quickly. It's largely stuff I don't care about unless it's what I'm currently dealing with, but it piles up.

Do the thousands upon thousands of lines that build up in the tabs I have open meaningfully impact the performance of my operating system? (In my case, MacOS)

I'd be curious to get a better sense of how this memory is managed and what does and does not hog resources in this regard.

Did you find this post useful? Show some love!
DISCUSSION (18)

Back of the envelope:

5000 lines * average 100 unicode characters * average 2 bytes (probably most are ASCII 1 byte but whatever) ~= 1.000.000 bytes ~= 1MB

1MB * 25 tabs = 25MB.

Adblock Extension (when is idle) 300MB

I would say it is ok, your cognitive load on keeping that many terminals is way bigger then the technical load of them :D

That is another reason because I prefer uBlock

Thanks, after a quick test it uses 60% less RAM and block with 10% more requests than AdBlockPlus.

The web got crazy, 82 blocked requests on wired.com and the website is still working ... and the Media > xkb option is crazy, never thought of that.

uBlock follow other rules in context about ads, check this is an awesome reading...

Not sure if you have any control, but that link you linked's SSL Cert expired last week.

Yes I know but when I read the Cert was fine, maybe the owner didn't renew it

isn't the OP about terminal tabs instead of browser tabs?

Just pointing out that 25MB of ram is nothing nowdays πŸ˜€. And if he has dozens of terminal tabs imagine how many browser tabs he has open πŸ˜€

Yes. The point is to have a basis for comparison.

Activity Monitor should tell you info about it. (MacOS) yes each tab has its own process (Chrome: Helper). And yes if we are speaking about browser or terminal 'lines' those are all in buffer ram.. which you can set in preferences for iTerm for example.

alt

alt

Are you just curious or you actually notice something? I'm curious why you're curious. πŸ€”

Processes like kernel_task are pretty opaque and take up a lot of memory sometimes. Terminal also has a pretty large impact occasionally but I'm not entirely sure how to ingest what is responsible for what. Finder can have a big impact, but I'm not always sure why.

Agreed, why does finder eat up 25%+ CPU? Ever since I found htop many years back it has been my go-to for process monitoring.

htop rocks, and do not forget to press H to group the threads.

Do you use anything like iStat Menus? It's a fantastic little toolbar application that can show you when things are spinning out of control, like you forgot you had a VM running, heavy disk I/O, or memory pressure.

Terminal is pretty low-key, but sometimes sub-processes of Terminal get lumped into the Terminal.app memory footprint in some visualizations. That means running a Docker VM can make it seem like Terminal is a huge hog.

The biggest pain is scroll-back buffers, but that's only a factor if you have them set to unlimited and are doing something like tail -f on a very busy log file.

It depends on your terminal - most terminals can be configured to remove old lines from memory, which lowers the memory footprint. Also, I believe I read somewhere that some terminals can store their scrollback in files, which also lowers memory usage, but obviously has security implications if you're running sensitive commands.

As far actually memory usage goes, that also depends on the terminal - I have 10,000 lines of scrollback in urxvt, and filling that up increases my memory usage by about 16MB.

The main factor is whether infinite scrollback enabled.

If you have finite scrollback, then your memory usage is going to be bounded; otherwise, no.

Classic DEV Post from May 10

If your programming language were a Pokemon, which would it be?

...

READ POST
Follow @ben to see more of their posts in your feed.
Ben Halpern
A Canadian software developer who thinks he’s funny.
Trending on dev.to
Here's Why You Should Quote Your Variables in Bash
#bash #beginners #devops #linux
Find someone to mentor
#productivity #career #devto
He commits vendor! 😱
#discuss #vendoring
Barking at the right tree (1000 followers)
#meta #career #blog
How Can I Help Foster A Culture of Continual Learning?
#discuss #learning
Choose Your Next Article Topic With This Exercise
#writing #productivity
Any idea how to start blogging as a developer?
#discuss #idea #blog
Who is hiring? (As of October 2018)
#whoishiring #discuss