I am developing an application in App Engine and using kmeans2 from SciPy.
When a cluster, I get this error:
Exceeded soft private memory limit with 159.852 MB after servicing 1 requests total
That's what I'm doing, color_data will be about 5 million x, y, z points:
def _cluster(color_data, k): """ Clusters colors and return top k Arguments: ---------- color_data TYPE: list DESC: The pixel rgb values to cluster k TYPE: int DESC: number of clusters to find in the colors Returns: -------- sorted_colors TYPE: list DESC: A list of rgb centroids for each color cluster """ k def _cluster(color_data, k): """ Clusters colors and return top k Arguments: ---------- color_data TYPE: list DESC: The pixel rgb values to cluster k TYPE: int DESC: number of clusters to find in the colors Returns: -------- sorted_colors TYPE: list DESC: A list of rgb centroids for each color cluster """ the colors def _cluster(color_data, k): """ Clusters colors and return top k Arguments: ---------- color_data TYPE: list DESC: The pixel rgb values to cluster k TYPE: int DESC: number of clusters to find in the colors Returns: -------- sorted_colors TYPE: list DESC: A list of rgb centroids for each color cluster """ , [], [] def _cluster(color_data, k): """ Clusters colors and return top k Arguments: ---------- color_data TYPE: list DESC: The pixel rgb values to cluster k TYPE: int DESC: number of clusters to find in the colors Returns: -------- sorted_colors TYPE: list DESC: A list of rgb centroids for each color cluster """ clusters def _cluster(color_data, k): """ Clusters colors and return top k Arguments: ---------- color_data TYPE: list DESC: The pixel rgb values to cluster k TYPE: int DESC: number of clusters to find in the colors Returns: -------- sorted_colors TYPE: list DESC: A list of rgb centroids for each color cluster """ zip (x, y, z)), k, iter = def _cluster(color_data, k): """ Clusters colors and return top k Arguments: ---------- color_data TYPE: list DESC: The pixel rgb values to cluster k TYPE: int DESC: number of clusters to find in the colors Returns: -------- sorted_colors TYPE: list DESC: A list of rgb centroids for each color cluster """ . count (i) def _cluster(color_data, k): """ Clusters colors and return top k Arguments: ---------- color_data TYPE: list DESC: The pixel rgb values to cluster k TYPE: int DESC: number of clusters to find in the colors Returns: -------- sorted_colors TYPE: list DESC: A list of rgb centroids for each color cluster """
How can I do this under the 128 MB of memory?
EDIT: On my local computer run my application shows ~ 500 MB of memory used in my activity monitor
source share