Skip to content

XMLHttpRequest memory leak #1311

Open
Open
@kiture

Description

@kiture

Bug Report

Problem

After switch from version 4.5.5 to 6.2.0 there is a problem with XMLHttpRequest. In my app i'm downloading many files from server that are saved on device.

When i'm call this method many times likes ~400 (depends on device) on ~1MB file, the application crashes (before crash there is a warning about memory leak in Console app on Mac).

function load() {
	this._loader = new XMLHttpRequest();
	this._loader.open("GET", path, true);
	this._loader.onload = () => {
		if (this._loader.status != 200) {
			return;
		}
		load();
	};
	this._loader.responseType = "arraybuffer";
	this._loader.send();
}

This method just downloading file and does nothing with it (GC should just clean this).

This issue is similar to this one: #522

In version 4.5.5 all works fine, without any problem.

Environment, Platform, Device

iOS 15.7.3 (iPad mini 4)
iOS (iphone 11)

Version information

cordova-cli 11.1.0
cordova-ios 6.2.0

Checklist

  • [x ] I searched for existing GitHub issues
  • [x ] I updated all Cordova tooling to most recent version
  • [x ] I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions