Java Virtal Machine.net

[ News ] rss

February 01, 2011

Mark Wielaard: New GPG key. Finally created a new GPG key using gnupg. The old one was a DSA/1024 bits one and 8 years old. The new one is a RSA/2048 bits one. I will use the new one in the future to sign any release tarballs I might create. pub 2048R/57816A6A 2011-01-29 Key f...

More »

February 01, 2011

Andrew Hughes: [SECURITY] IcedTea6 1.7.8, 1.8.5, 1.9.5 Released!. We are pleased to announce a new set of security releases, IcedTea6 1.7.8, IcedTea6 1.8.5 and IcedTea6 1.9.5. This update contains the following security updates: The IcedTea project provides a harness to build the source code from OpenJDK6 u...

More »

April/2024
SunMonTueWedThuFriSat
 123456
78910111213
1415161718 1920
21222324252627
282930    

[ Archives News
for 'Java Technology' ]

home > news > java technology > the java "code too large" problem: reproduced and analyzed

The Java "Code Too Large" Problem: Reproduced and Analyzed

I came across an interesting demonstration and analysis of the Java "code too large" error in a post by Dustin Marx, Reproducing "code too large" Problem in Java. In the post, Dustin describes his effort to intentionally produce the "code too large" error. Why would someone do this? In this case, it is because I always understand things better when I tinker with them rather than just reading about them and because doing so gives me a chance to demonstrate Groovy, the Java Compiler API (Java SE 6), and javap. And off Dustin goes. His first discovery is that 65535 bytes of compiled byte code is the number that produces the "code too large" error. And these 65535 bytes have to be the compilation of a single method. Now, realistically, what programmer would ever create a single method that compiled down to 65535 or more bytes? No one I've ever met. Yet, the "code too large" problem does actually exist "in the wild" (as Dustin calls it) -- specifically, it can happen when code is generated by, for example, Groovy. To analyze the problem, Dustin built a Groovy script that: generates a Java class that isn't very exciting. However, the class will have its main function be of an approximate size based on how many conditions I tell the script to create. This allows me to quickly try generating Java classes with different main() method sizes to ascertain when the main() becomes too large.After the script generates the ...


Date: January, 19 2010
Url: http://www.java.net/blog/editor/archive/2010/01/19/java-code-too-large-problem-reproduced-and-analyzed


Others News

©2002-2019Java-Virtual-Machine.net https://mobirise.com/ | nl | best website design software | bootstrap dropdown menu | bootstrap navbar