illyabusigin / CYRTextView

CYRTextView is a UITextView subclass that implements a variety of features that are relevant to a syntax or code text view.
MIT License
535 stars 68 forks source link

Crashes with large test files #11

Open Boyeen opened 10 years ago

Boyeen commented 10 years ago

I noticed this in my own code but also in the demo. Everything works fine for small snippets but a largish file, say 100+ lines of code, allocates more and more memory then ultimately is terminated after scrolling a while. In fairness, I'm convinced this is due to memory leaks with UITextView in iOS7. I'm just wondering if anyone has found a workaround. It makes CYRTextView unusable for my purpose.

illyabusigin commented 10 years ago

Hi Boyeen,

Good catch. I'll investigate this issue and see what I can find.

Boyeen commented 10 years ago

Hi Ilya,

Any further insight? As I'm sure you have found, iOS7 has some horrible bugs. The worst seems to me the poor memory deallocation algorithm. I am certain the bug I reported to you is not in your code, I see it in a regular UITextView with 1000 lines of code. I think it is related to ARC and the ongoing crashes of Springboard, especially in A7 devices. iOS7.1 helped a little but nowhere near enough. So, I would welcome your input.

BTW I really love the look of CYRTextView and plan to use it in my own app when I can reliably scroll 1000 lines of code.

zyavrik commented 10 years ago

Boyeen, did you fix the issue with large files?

Boyeen commented 10 years ago

Nope. It's very frustrating. It seems to be a problem in ARC/iOS7. If you try, you can recreate it using a totally standard UITextView although the memory usage doesn't grow as fast without the annotated strings.

On Fri, Jun 6, 2014 at 12:53 AM, altaveron notifications@github.com wrote:

Boyeen, did you fix the issue with large files?

— Reply to this email directly or view it on GitHub https://github.com/illyabusigin/CYRTextView/issues/11#issuecomment-45311657 .

Topcat Games - www.topcatgames.com

zyavrik commented 10 years ago

Boyeen, what do you think about the following issue? https://github.com/illyabusigin/CYRTextView/issues/17

jayztemplier commented 9 years ago

hey @Boyeen , so, I have the same issue and noticed big performances issues when opening a large file , and scrolling.

If you shortcut the drawRect method (it only makes the line gutter fancy), the scrolling problem will go away. I'm planning on working on a PR to improve the perf of the drawRect.

For the problem of opening big files (it takes a while to process and display it) I'm still investigating what is the issue.