473,437 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,437 software developers and data experts.

65535 limitation for methods / functions / constructor

Can anybody answer me the question if there is any possiblity to
increase the 65535byte limitation for Java classes / methods /
functions / constructors etc.

I am currently researching in the field of Bayesian Networks. BN is a
special Knowledge representation which uses calculation via
conditional probabilities to come to a conclusion (out of some data).
The problem is that these Networks need a huge amonge of dependet
data. One of the BN Engines i am using wants to get the data input by
a class file. Some of these datas are also stored in an array of
doubles ( please dont ask me why, but the engine wants this data like
that) . My Problem now is that this array has 1024 Elments with up to
13 digits. This means the array on itself has the size of 84KB. I
cannot put this array anywhere not in the constructor or method etc.
because i cannot compile the java file (eclipse ) or i get an runtime
error which says :

Exception in thread "main" java.lang.ClassFormatError: BNP_alarm (Code
od longer than 65535 bytes)...

I thought about splitting up the array but that is such a bad solution
i dont want to think about it.

Please can anybody help me with my concern and tell me if there is any
possibility to increase the limitation. Thanks Elmar
Jul 17 '05 #1
4 7051
Java bytecode isn't designed very well for supporting array initialization.
There's a few of workarounds, and you'll see them used in the Java library
itself. Your suggestion of splitting the arrays is probably the best
workaround. Another option is to store the doubles in a separate file,
within the same package, and then load the file as a resource. Then you have
to go through and parse it.

"Elmar Grandel" <El***********@huskymail.uconn.edu> wrote in message
news:fc**************************@posting.google.c om...
Can anybody answer me the question if there is any possiblity to
increase the 65535byte limitation for Java classes / methods /
functions / constructors etc.

I am currently researching in the field of Bayesian Networks. BN is a
special Knowledge representation which uses calculation via
conditional probabilities to come to a conclusion (out of some data).
The problem is that these Networks need a huge amonge of dependet
data. One of the BN Engines i am using wants to get the data input by
a class file. Some of these datas are also stored in an array of
doubles ( please dont ask me why, but the engine wants this data like
that) . My Problem now is that this array has 1024 Elments with up to
13 digits. This means the array on itself has the size of 84KB. I
cannot put this array anywhere not in the constructor or method etc.
because i cannot compile the java file (eclipse ) or i get an runtime
error which says :

Exception in thread "main" java.lang.ClassFormatError: BNP_alarm (Code
od longer than 65535 bytes)...

I thought about splitting up the array but that is such a bad solution
i dont want to think about it.

Please can anybody help me with my concern and tell me if there is any
possibility to increase the limitation. Thanks Elmar

Jul 17 '05 #2
El***********@huskymail.uconn.edu (Elmar Grandel) wrote in message news:<fc**************************@posting.google. com>...
Can anybody answer me the question if there is any possiblity to
increase the 65535byte limitation for Java classes / methods /
functions / constructors etc.


hi
i guess storing data in a file & then reading it should be a good idea
in your case ....

regards
amey
Jul 17 '05 #3
Ok, so me and my calculator can't figure out how you get 84KB.
A double can hold signed values of over 18 digits. This is ok. BUT
A double is 8 bytes, times 1024 is 8,192 or less than 1/10 your value.
"Elmar Grandel" <El***********@huskymail.uconn.edu> wrote in message
news:fc**************************@posting.google.c om...
Can anybody answer me the question if there is any possiblity to
increase the 65535byte limitation for Java classes / methods /
functions / constructors etc.

I am currently researching in the field of Bayesian Networks. BN is a
special Knowledge representation which uses calculation via
conditional probabilities to come to a conclusion (out of some data).
The problem is that these Networks need a huge amonge of dependet
data. One of the BN Engines i am using wants to get the data input by
a class file. Some of these datas are also stored in an array of
doubles ( please dont ask me why, but the engine wants this data like
that) . My Problem now is that this array has 1024 Elments with up to
13 digits. This means the array on itself has the size of 84KB. I
cannot put this array anywhere not in the constructor or method etc.
because i cannot compile the java file (eclipse ) or i get an runtime
error which says :

Exception in thread "main" java.lang.ClassFormatError: BNP_alarm (Code
od longer than 65535 bytes)...

I thought about splitting up the array but that is such a bad solution
i dont want to think about it.

Please can anybody help me with my concern and tell me if there is any
possibility to increase the limitation. Thanks Elmar

Jul 17 '05 #4
"Phil..." <ry***@ieee.org> wrote in message news:<9eFeb.8112$%h1.6389@sccrnsc02>...
Ok, so me and my calculator can't figure out how you get 84KB.
A double can hold signed values of over 18 digits. This is ok. BUT
A double is 8 bytes, times 1024 is 8,192 or less than 1/10 your value.


Thanks a lot everybody for your help. I solved the problem with
reading the data and parsing all the data ( by JavaCC) in an array in
runtime.
Phil, you calculated right but i forgot to but another digit in the
1024. Actually it is an array with 10368 doubles, so that is round
about 83kB big array.
Bye Elmar
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

99
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less...
17
by: Picho | last post by:
Hi all, I popped up this question a while ago, and I thought it was worth checking again now... (maybe something has changed or something will change). I read this book about component...
4
by: MPF | last post by:
When designing a n-tier architecture, what is the preferred method/function accessibility? <Specifically for asp.net apps> A private constructor and shared/static methods & functions? A public...
10
by: John | last post by:
Trying to find out what is essential / optional, I made an extremely simple Class and Module combination to add two numbers. (see below) It appears that an empty constructor is needed n order to...
12
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. ...
6
by: Taran | last post by:
Hi All, I tried something with the C++ I know and some things just seem strange. consider: #include <iostream> using namespace std;
3
by: rickeringill | last post by:
Hi comp.lang.javascript, I'm throwing this in for discussion. First up I don't claim to be any sort of authority on the ecmascript language spec - in fact I'm a relative newb to these more...
26
by: Cliff Williams | last post by:
Can someone explain the pros/cons of these different ways of creating a class? // 1 function myclass() { this.foo1 = function() {...} } // 2a
5
by: bizt | last post by:
Hi, Below I have a simple object / function thing (still getting head round these) declaration: function MyObject() { this.alertMe = function() { alert('hello'); }; this.alertMeAgain() {
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.