muit dimentional array size limts?

Everything else that doesn't fall into one of the other PB categories.
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

muit dimentional array size limts?

Post by Dreglor »

i was testing my 3d engein and i came across a error
i couldnt find what it was causing until i reduced the size of the array
what i had was 2D array and i had the size of it 1,000,000 on both indexs
so it look like this

Code: Select all

#HW_limit.l=1000000
Dim O_vertex_X.f(#HW_limit,#HW_limit)
theres no error initalizing it but when you try to put an value into the array it gives an error

i not sure what the limt on it is but could some one point this out to me ,it would be very useful, right now all i know is it is between 10000 and 100000
it would be very useful
~Dreglor
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

i think you ran out of memory on that array as it consumes 1000000*1000000*4 bytes = 10e12 * 4 bytes which translates to approx. 3725 GByte :)


Rougly you can say that the limit is the amount of memory installed + maybe some swap memory..
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post by Dreglor »

your proably right but you think that it would crash when i was initalizing it
edit
you are right, i did that formula you did to find how much memory an array will take and useing 10000 (which works) takes up 400meg of space (i have 512meg)
~Dreglor
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

> 400meg

Wow, i'm the only one, who think, that is realy to much...
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post by Dreglor »

>>1000000*1000000*4 bytes = 10e12 * 4 bytes which translates to approx. 3725 GByte

well i did it on my calulator and it came out as 4 terrabytes (4000gigs)
werid?
i cheaked it like 4 times...
i used the windows calulator mabey thats why...
~Dreglor
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

1 K=1024 bytes, 1 Meg=1048576 bytes, 1 gig=1073741824 bytes 8O
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post by Dreglor »

hmm thanks for poiting that out jack,
i always gone by 1000
wonder why they have it like that?
1024bytes=2048bits...
~Dreglor
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

Dreglor wrote: hmm thanks for poiting that out jack,
i always gone by 1000
wonder why they have it like that?
1024bytes=2048bits...
No dude.. 1024 bytes is not 2048 bits... 1024 bytes = 8192 bits... (8 bits in a byte) :wink:

why 1024 etc.. it's because that's the way the binary and hexdecimal counting methods work...

-Lars

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post by Dreglor »

ooooOOOOOooooh now i get it
~Dreglor
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

Dreglor wrote: ooooOOOOOooooh now i get it
Hehe... easy once you understand it, isn't it?!? ;) 8)

-Lars

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Some notes:
8Bit=1Byte
1024 Byte = 1 KiloByte
1024 KB = 1 MegaByte
1024 MB = 1 GigaByte
1024 GB = 1 TerraByte

Some intelligent Persons have calculated, that the complete knowledege of the mankind can be stored in 14 Terrabytes...

Note: 8Kb=1KB (Kb=KiloBit KB=KiloByte)

And Important: Producers of HDDs calculate wrong, they calculate with 1000!

GPI
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

4 bits = 1 nibble
16 bits = 4 nibbles or quad-nibble (older amiga- or C64 - user remember NibbleCopy ?)
16 bits in german -> Drunken already ;)
SPAMINATOR NR.1
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

And don't forget:
2 Bytes = 1 Word
2 Word = 1 Long
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

Dreglor,

What on earth are you using an array that size for?

Tell us, I'm sure somebody can suggest a better data structure.
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post by Dreglor »

i doing a 3d engein (probably in the worst possible way) the arrayS are for vertex's x, y, z on a singel object and i also have it set up so faces can be defineded by the ids of the vertexs and the object

i am also useing an object oriented system (if you havn't already noticed) so that bumps up most arrays up one more dimention
~Dreglor
Post Reply