I'm adding a new answer to this page to include the step by step instruction in order to autoscale based on percent memory used which has been made simpler with the evolution of the platform.
The OP may have received the message they did at the time of the post as a result of autoscaling not supporting the required metric at the time.
Memory can now be monitored by installing the Stackdriver agent on a machine, as opposed to the previous requirement for a custom metric needing to be created. It's therefore much easier to monitor memory now, as well as autoscale based on memory usage (which is now supported). It should be noted however that Premium tier Stackdriver account is required to use the monitoring agent.
You need a managed instance group to autoscale, and the machines within that managed instance group need the Stackdriver agent installed on them to monitor memory.
There are a couple of ways you can do this. You could add a start-up script to the instance template that the managed instance group uses and add the commands required to install the monitoring agent (see here), or you could create an image that already has the monitoring agent installed and use this image as the source image for the instances in the group (please see supported operating system for the agent here).
Here are some steps you could follow to install the monitoring agent via a startup script, and then autoscale based on percent memory used.
1) Design an instance template. Compute Engine > instance templates> Create Instance Template.
2) In the 'Startup script' section of the create instance template page add the following:
#!/bin/bash
curl -sSO https://dl.google.com/cloudagents/install-monitoring-agent.sh
sudo bash install-monitoring-agent.sh
3) Create a managed instance group:
Compute Engine > Instance Groups > Create instance group
4) Ensure you select the following options (in addition to your others personalised options) for your instance group in the relevant fields:
'Group type' = 'Managed instance groups'
'Instance Template' = Select the instance template you created in step 1/2.
'Autoscale based on' = 'Stackdriver monitoring metric'
'Metric identifier' = 'agent.googleapis.com/memory/percent_used'
'Target' = The percent of memory you would like to initiate the autoscaler, for example 60
You now have a managed instance group set to autoscale based on percent memory used.