This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 196467

Summary: static field ValidationTransaction.preloadedSchemas holds about 10MB of unGCable memory
Product: web Reporter: Marek Fukala <mfukala>
Component: HTML EditorAssignee: Marek Fukala <mfukala>
Status: VERIFIED FIXED    
Severity: normal CC: jlahoda, mmirilovic, pjiricka, ppisl, vriha
Priority: P2 Keywords: PERFORMANCE
Version: 7.0   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 195337    

Description Marek Fukala 2011-03-09 08:29:13 UTC
Html validator loads the html schemas during the initialization. The schemas occupies about 10MB of memory which is never GCed even if the needed. OTOH the schemas creation is very costly so it is questionable whether it is even desired to GC them.

see the exception report http://statistics.netbeans.org/exceptions/exception.do?id=490857
Comment 1 Marian Mirilovic 2011-03-10 10:08:54 UTC
Marek, do you think you will be able to fix it for NB 7.0 ? If so I would vote for it.
Comment 2 Marek Fukala 2011-03-10 10:17:56 UTC
I was just about to ask whether this issue is considered as serious and hence should be P2 and fixed for 7.0. :-). So OK, I'll take a look at it.
Comment 3 Marek Fukala 2011-03-18 15:30:05 UTC
fixed in web-main#54d80248ab72

Honzo, since you've filed one duplicate of this issue, could you please review the fix. In short the mentioned static field now holds a group of Schema instances which wraps the original instancies. The delegates are held softly and created lazily. 

Another advantage of the fix is that the validator initialization is faster since only empty shells are created and until the schema is really needed it is not loaded and initialized.
Comment 4 Marek Fukala 2011-03-18 15:35:53 UTC
Vladimire, can you please verify the trunk fix once it's available? Opening/creating/closing/deleting of x/html documents with various doctypes should do that. Also please observe whether the error checks are working properly. Thanks in advance!
Comment 5 Vladimir Riha 2011-03-18 16:56:34 UTC
OK, so If I understand it right, I should try to open/create/... (x)html files and check memory usage and the error check?
Comment 6 Jan Lahoda 2011-03-18 17:34:05 UTC
The patch seems fine to me. Thanks.
Comment 7 Marek Fukala 2011-03-21 08:47:26 UTC
(In reply to comment #5)
> OK, so If I understand it right, I should try to open/create/... (x)html files
> and check memory usage and the error check?
you do not have to check the memory usage, just verify whether there are some functional (bad) consequences of the fix.
Comment 8 Marek Fukala 2011-03-22 13:56:45 UTC
Vlado, have you look at the issue? I'd like to integrate to the 7.0 branch...
Comment 9 Vladimir Riha 2011-03-22 14:53:59 UTC
So far, It doesn't seem to be in any build
Comment 10 Marian Mirilovic 2011-03-24 08:36:27 UTC
(In reply to comment #9)
> So far, It doesn't seem to be in any build

Marek : so what is the status of this issue ?
Comment 11 Quality Engineering 2011-03-24 09:49:59 UTC
Integrated into 'main-golden', will be available in build *201103240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/54d80248ab72
User: Marek Fukala <mfukala@netbeans.org>
Log: #196467 - static field ValidationTransaction.preloadedSchemas holds about 10MB of unGCable memory
Comment 12 Vladimir Riha 2011-03-24 16:58:33 UTC
Seems fine, verified
Comment 13 Marek Fukala 2011-03-25 21:26:26 UTC
changeset:   195070:bc225693d9ad
branch:      release70
user:        Marek Fukala <mfukala@netbeans.org>
date:        Fri Mar 18 16:22:31 2011 +0100
summary:     #196467 - static field ValidationTransaction.preloadedSchemas holds about 10MB of unGCable memory