Radeon RX 580 8GB vs 4GB. Does memory matter? Does GPU with more memory provide better mining for Ethereum? Here is a Quora an answer: 


  In general, 4GB is sufficient for even the most demanding hashing
  algorithms and you will not see any performance gains just by having
  more memory. This is where the speed and quality of the memory comes
  into play. The 8GB RX 480 has a higher memory clock speed which gives
  it a slight edge while running memory intensive algorithms such as
  Ethash (used by Ethereum). When running at the same core clock, the
  hashing speed of a 8GB RX 480 can be higher by 25–30 hash/sec compared
  to the 4GB RX 480.
  
  However, hashing speed also depends on the quality of the GDDR5
  memory. Samsung based chips seem to perform little better (20–25
  hash/sec) compared to Hynix or Elpida. They are also easier to
  overclock.


What about Radeon RX 580, which one is better? In what cases should I consider memory?
Memory size does not affect mining speed.

To mine you need DAG file to be loaded into card's memory. DAG file grows in time. So when (and if) it will superpass 4GB - you could mine no more with these cards. Current Eth DAG size is ~2.3Gb. 4Gb is expected roughly on 06/FEB/2021 - after that date you will not be able to use 4Gb cards to mine Eth (and Im not even considering PoS here)