Before you update please you take backup of files and database. Also make sure prerequisites like complete the update and upgrade checklist, check PHP and environment settings, enable maintenance mode if needed.
First we need to understand how images are stored in the database and what are the tables involved that stores the image name, entity_id, attribute_id and attribute_code.
Magento releases patches of many types like cross-site scripting vulnerability issue, backward compatibility issues, module specific issues, hot fixes etc. These patches are very important to install in our Magento Instance for many reasons. Let’s get started.
Easy solution is using Magento 2 CLI and adding memory limit inside command i.e. dmemory_limit=3G
Magento has an in-built profiler that can be used to identify performance problems on the server side.