Connect to your SQL express instance
OSQL -E -S SERVERNAME\INSTANCE
If advance options are not enable :
sp_configure 'show advanced option', '1' RECONFIGURE WITH OVERRIDE GO
Run the following code, replacing the in quote data with value you need :
EXEC sp_configure 'max server memory', 'memory in MB' GO RECONFIGURE WITH OVERRIDE GO