Search Issue Tracker

Fixed in Unity 4.6.1

Votes

0

Found in

4.5.3f3

Issue ID

632166

Regression

No

Memory leak in WWW class on iOS

iOS

-

-

Priority: 7Not yet prioritized for a release

-

Severity: 3Secondary functionality broken

CFURLRequest, a NSMutableURLRequest and a NSURLRequestInternal objects are not released from memory in the cleanup function.

After implementing the changes to the cleanup function in WWWConnection.mm suggested by the user (in the initial report), the total memory consumption falls by about 30mb when creating 10 000 WWW objects.

Comments (9)

  1. 25ed87882ea8e75a67f2ed28843bb90b?d=mm

    Monarc

    Dec 20, 2018 10:43

    This still occur in 5.6.5

  2. E4813746d28ba58204d49727f6e6bd4e?d=mm

    fourdesire

    Dec 25, 2016 13:40

    This happened again in 5.5.0 ios 10

    and can be fixed by

    Change the line
    NSMutableString* headerString = [NSMutableString stringWithCapacity:1024];

    to
    NSMutableString* headerString = [[NSMutableString stringWithCapacity:1024] retain];

  3. Dfcd95865b144f7216a380716b113d7b?d=mm

    htudrshtsrhtsthsht

    Oct 27, 2014 08:28

    I had the same problem (memory leak on WWW request), see thread:

    http://answers.unity3d.com/answers/818219/view.html

    and bug report:

    http://fogbugz.unity3d.com/default.asp?642466_u3apn704bp9ko5q7

  4. Dfcd95865b144f7216a380716b113d7b?d=mm

    htudrshtsrhtsthsht

    Oct 27, 2014 08:27

  5. 24ca5f720a29beee1e00a8cce0d91f65?d=mm

    mason2014

    Oct 22, 2014 02:45

    Cause a crash when release WWW object,please fix it as soon

  6. 28d5d8f787dc497f7f6e99cad283a6d1?d=mm

    DimensionU

    Oct 17, 2014 19:07

    I'm seeing the same crash reported by JamesMilkCap. I can also confirm that GrahamReeves' suggestion does eliminate the crash.

  7. 7f40b65cc5eba9eea67b6f84ad51bdb6?d=mm

    GrahamReeves

    Oct 17, 2014 12:20

    This can be fixed in the trampoline code,

    in iPhone-Trampoline/Classes/Unity/WWWConnection.mm, line 134
    didReceiveResponse

    Change the line
    NSMutableString* headerString = [NSMutableString stringWithCapacity:1024];

    to
    NSMutableString* headerString = [[NSMutableString stringWithCapacity:1024] retain];

  8. B3f7b08ba5c3fae8a0b8e7aa66943cf4?d=mm

    Tommi-Kiviniemi

    Oct 17, 2014 10:57

    Same here. In our case it is a fetch request for getting Facebook friends (through the FB API) that is crashing once the WWW object is being cleaned up.

    Please fix this in the next patch release for 4.5.5 as 4.5.5p1 is totally unusable due to this.

  9. Ecad5cf0a5d48a8bbf2830b6122dbe77?d=mm

    jamesmilkcap

    Oct 17, 2014 09:28

    Seeing a crash that's being caused by this fix (in 4.5.5 p1).

    Here's a screenshot:

    https://lh3.googleusercontent.com/-ak9kqr2HNsw/VEALrDHR1SI/AAAAAAAAANs/Mgm4C7C7Qmo/w1359-h954-no/GameCenterCrash.png

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.