Skip to content

Getting Out Of Memory  #520

@nhjariwala

Description

@nhjariwala

I have fragment while changing orientation of fragment I got OOM.

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
    if (mLogEnabled)
        Log.i(LOG_TAG, "OnSizeChanged()");

    if (w > 0 && h > 0 && w < 10000 && h < 10000) {
        // create a new bitmap with the new dimensions
        mDrawBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_4444); // Error Here
        // mDrawCanvas = new Canvas(mDrawBitmap);
        mViewPortHandler.setChartDimens(w, h);

        if (mLogEnabled)
            Log.i(LOG_TAG, "Setting chart dimens, width: " + w + ", height: " + h);
    }

    notifyDataSetChanged();

    super.onSizeChanged(w, h, oldw, oldh);
}

I have already retain the fragment but still it caused memory leaked. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions