Skip to content

Memory leak #7

@SteveMullen

Description

@SteveMullen

I am seeing a significant memory leak, and it's not clear to me what I can do about it.

Steps to Reproduce

When I request Properties (either through /Properties or /replication), each fetch results in a proportional memory usage. For replication where the limit is grabbing 2,000 listings, I see a usage of about 35 Mb.

Looping using the next url uses an equivalent amount of memory for each loop. For instance, when replicating, each batch of 2,000 listings adds to overall memory consumption by about 35 Mb. My script has a memory_limit of 512 Mb, and

Expected behavior:

I do not see any API method to free up the previous data. I am unsetting the returned json manually, but that is not helping.

Actual behavior:
Debug:
`
[replicate] [1] Replication found 2,000 listings [using 205,445,336 bytes]

[replicate] [2] Replication found 2,000 listings [using 240,005,560 bytes]

[replicate] [3] Replication found 2,000 listings [using 275,442,864 bytes]

[replicate] [4] Replication found 2,000 listings [using 310,723,216 bytes]
`

Reproduces how often:
This is consistent behavior.

Versions

Using the latest Aug 13, 2018 version of RESO-WebAPI-Client-PHP
php 7.2

Additional Information

`do {
RESO\RESO::setAccessToken("my auth token");
RESO\RESO::setAPIRequestUrl("https://api.bridgedataoutput.com/api/v2/OData/miamire/");
$this->replicate_url = "/replication";

RESO\Request::setAcceptType("json");

$json_obj							= RESO\Request::request($this->replicate_url, 'json', $decode_json = true);

$this->replicate_url				= null;
if (is_array($json_obj))
	{
	if (isset($json_obj['@odata.nextLink']) && !empty($json_obj['@odata.nextLink']))	{
		$this->replicate_url		= $roverWEBAPIAUTH->reso_property_replication_url(
																				$one_class, 
																				$json_obj['@odata.nextLink']
																				);
		}
	}

unset($json_obj);
} while (!is_null($this->replicate_url));`

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