By default, Pylance is limited by the memory available to Visual Studio Code Electron application. It is troublesome to change this.
However Pylance has an option to launch itself in an external Node.js process for which you can set the max heap size.
This is available through Visual Studio Code settings. See the example settings below.