|Summary:||getting Maximum code footprint error after upgrade to Tomcat 8.5.11|
|Product:||Tomcat 8||Reporter:||M. Manna <manmedia>|
|Component:||Jasper||Assignee:||Tomcat Developers Mailing List <dev>|
Description M. Manna 2017-01-20 01:34:45 UTC
Comment 1 Remy Maucherat 2017-01-20 08:36:07 UTC
Additional code was added for error handling, which undoubtedly increases the method sizes. It is thus possible that some JSP which was too close to the limit not has an issue.
Comment 2 M. Manna 2017-01-20 08:55:01 UTC
I can confirm that the issue is prevalent when you have a multipart form built using 2-3 JSP forwards. And my java version is JDK 8 Update 121. Have you guys had the issue with this JDK?
Comment 3 M. Manna 2017-01-23 09:30:23 UTC
Also found the same problem when downgraded to 8.0.39. Hence, downgrading to 8.0.29. I am not facing the issue anymore with 8.0.29. Could someone please let me know if a bugfix will be done on 8.5.11?
Comment 4 Mark Thomas 2017-01-23 09:40:34 UTC
There is no bug here. The code generated for JSPs got longer as additional error handling had to be added to tags. JSps that use a lot of tags and/or were close to the limit are likely to need to be refactored to bring them under the limit.
Comment 5 M. Manna 2017-01-23 09:50:20 UTC
Thanks - But isn't this going to cause quite a lot of Legacy systems to be broken? Or do you expect developers to use the older versions of Tomcat?
Comment 6 Mark Thomas 2017-01-23 12:07:29 UTC
The users list is the best place to discuss ways to handle problems with overly large methods. I've taken a quick look at the generated source and I don;t see any obvious ways to reduce the size of the generated method.
Comment 7 Mark Thomas 2017-01-27 10:04:19 UTC
While the long term advice is still try to restructure the JSP, I've spent time looking more closely at the generated code. I found several potential changes that might reduce the overall size of the _jspService() method but because of compiler optimisations, changes that look like they should reduce the method size, don't always have the expected effect. I've now implemented the changes that appear to have a positive effect in trunk (9.0.x). With the tag I was testing with (the foo tag from the JSP examples) the number of instances of the tag I could use on a single page were: - before the try/finally clean-up fixes - 301 - after the try/finally clean-up fixes - 221 - after clean-up but with optimisations - 292 The figures will vary from tag to tag. The more attributes a tag has, the greater the effect of the optimisations (the foo tag has three). I'd like to get some feedback on these changes from end-users (to the dev@ list please) before back-porting them so any feedback you can provide based on testing of the current trunk (9.0.x) would be appreciated.
Comment 8 Mark Thomas 2017-01-27 10:05:44 UTC
*** Bug 60653 has been marked as a duplicate of this bug. ***
Comment 9 Mark Thomas 2017-01-27 14:51:20 UTC
One of the optimisations was buggy. Removing it gives: - after clean-up but with optimisations - 258 Setting mappedFile to false permits another 10 tags to used.