0

I tried Brave on Mac with the command in the answer by K J in the following question. But after running many such conversions, I may end up with a message of -bash: fork: retry: Resource temporarily unavailable in a terminal. It seems that too many threads are used and not cleaned afterward. What is going wrong here?

How to use brave to automate printing html to pdf?

halfer
  • 19,824
  • 17
  • 99
  • 186
user1424739
  • 11,937
  • 17
  • 63
  • 152
  • Let me know if you find anything new. I can not easy see what processes are relevant on my machine as there are many processes running on my mace system. – user1424739 Dec 14 '22 at 14:14

1 Answers1

0

Ok I guess this may not be normal type of answer as its kind of "works for me"

In cases such as this where the "programming" is simply one cross platform command, that in its dependencies uses system and application resources, there are times one user has problems and others do not. Thus debugging can be highly system dependent.

By way of explanation as to potential issues (and its too long for simple comments) here are my experiences on Windows.

pre running (why so many windows processes !!)

Fresh boot
Apps=3
one is system folder explorer
one is this notepad
one is task manager monitor
Background processes=82 Including Edge (inactive=5 !!)
processes=107 including console = 5 !!

Start command terminal
Apps =+1 with 3 sub processes ?
Background =+1 command prompt
processes =+1 (console now = 6)

Start Brave portable
apps =+1 Brave no page requested only welcome but with 8 sub processes !#?
background =+1 brave portable
processes =same (console still = 6)

Navigate to this page
apps = same Brave with this page requested = 9 then drops back to 8 sub processes !
background = same 1 brave portable
processes =same (console still = 6)

Run 20 similar commands with/without --enable-logging
Mea Culpa (Idiot) 20 fails several times because I did not verify if will run without a running Brave nor test bad cut and paste
but looks like no residual change to processes ??
Try again with brave closed

Apps and Background processes returns to before Brave active

for /l %a in (1,1,20) do brave-portable --headless --print-to-pdf="C:\Users\K\Downloads\brave-portable\test2-%a.pdf" --disable-extensions --print-to-pdf-no-header --disable-popup-blocking --run-all-compositor-stages-before-draw --disable-checker-imaging "https://stackoverflow.com/questions/74788259/how-to-use-brave-to-automate-printing-html-to-pdf"

Hmmm without error checking there is some noticed difference to an earlier run call completes in a few seconds thus its much too quick to see tasks listed in manager.

Background processes ramped up to 194 !! before drop back to about 78

and after about 20 seconds there are 19 same size files (as almost might be expected)

Now what is odd about that is that usually from experience they should all be different sizes as each call should show different in-page adverts over time but then again I had logged in and accepted cookies earlier, so there should be no ads to make a difference in later runs.

EXCEPT ONE rogue file out of 20 has an advert Arghhhhhhhh!!
so the inconsistencies saga continues.

However there is no residual use of task processes in my Windows portable Brave with that command sequence!

On its own Brave is using only a few percent of CPU and Memory before and after with no hint of tying up disk or other resource features.

K J
  • 8,045
  • 3
  • 14
  • 36