Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak #16

Closed
navisingh opened this issue Jan 13, 2016 · 3 comments
Closed

Memory leak #16

navisingh opened this issue Jan 13, 2016 · 3 comments

Comments

@navisingh
Copy link

Try running this test loop. You will observe a pretty serious memory leak.

   func testMemoryLeak() {
        let testNumber = "4081234567"
        for var i = 0; i < 100000; i++ {
            do {
                let phoneNumber = try PhoneNumber(rawNumber: testNumber)
//                phoneNumber.toE164()
            }
            catch {
                XCTFail()
            }
        }
        XCTAssert(true)
    }
@marmelroy
Copy link
Owner

Thanks @navisingh, something is definitely leaking... I'll investigate further this weekend...

@navisingh
Copy link
Author

Any progress with the leak? It looks like the regex code.

@marmelroy
Copy link
Owner

Found several issues (indeed inside the regex code) and fixed them with a new release (0.3). I still think there's more work to do to optimise memory usage. Closing for now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants