473,320 Members | 1,804 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,320 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 7041
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() {
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.