2

Doc says:

Starting with AIR 3 and Flash player 11, the size limits for a BitmapData object have been removed. The maximum size of a bitmap is now dependent on the operating system.

But, why can't I have 120,000 x 120,000 px BitmapData object? I'm on OS X Lion with 64 bit kernel.

Now 120,000 ^ 2 would give me 14,400,000,000 pixels I need to occupy, which takes only 34 bits to store that int. But apparently I can have 64 bit integers, no? Do I miss something? And what does it mean "dependent on the operating system"? How?

Aleksandr Makov
  • 2,820
  • 3
  • 37
  • 62
  • 2
    This bitmap data would take up 54GB. Even though, system is 64-bit, it may not be able to operate such large amount of memory. – kirilloid Apr 12 '12 at 08:21

3 Answers3

8

Since when is a BitmapData pixel equivalent to a single bit? Remember that you are dealing with color information, so each pixel occupies at least a uint(=> size:32 bits, or 4 Bytes).

Which, then, means that your memory consumption is actually

120000^2 * 4 => 57,600,000,000 Bytes => ap. 53,6 GB

Also note that while Number is a 64-bit data type, int and uint are not.

You might want to consider using a different means of organizing your data.
If you are dealing with a large picture, you have to split it up into parts of reasonable size. The limits may have been lifted, but I would recommend you restrain yourself to max. 4 times the stage size (that's small enough for reasonably smooth scrolling, and large enough so you don't have to place objects on the stage all the time).

If it is not actual pixel information you want to store, perhaps ByteArray could be a possible alternative.

weltraumpirat
  • 22,544
  • 5
  • 40
  • 54
  • Thanks for the answer. Made it clear. I just have to make Flash to produce print quality image, that is going to be printed to 10m x 10m outdoor banner. I did simple calculation, which gave me ~120,000 pixels @ 300 dpi to cover 10 meters. I would have gone another route if Flash could output vector graphics. – Aleksandr Makov Apr 12 '12 at 09:38
  • A print that size does not need 300 dpi - you are going to look at it from a distance! I used to work at a print shop for large scale banners like that - we scaled the images down to 10 dpi at times... – weltraumpirat Apr 12 '12 at 09:46
  • Besides, you can output just about anything from Flash, even postscript - it's text! http://www.simonheys.com/2007/06/05/postscript/ – weltraumpirat Apr 12 '12 at 09:48
  • Thanks for the info. I'll talk about it with my boss. However, we still can't convert text to curves in Flash. The approximation algorithm would take forever to calculate PS/SVG curves/lines of paragraphs of text. Well, it's not certain, just my feeling. Besides, my Flash app allows user to upload his own vector/raster images and embed them. Lots of technically difficult and limiting points out there. – Aleksandr Makov Apr 12 '12 at 10:01
  • 1
    You don't have to convert text to curves, you just need the appropriate PostScript fonts. You could, though, and I've done that, use a PostScript font outline to convert glyphs to vectors - the information is all in there. – weltraumpirat Apr 12 '12 at 10:16
1

Actually, there're several software and hardware limitations for amount of addressable size. Except 32/64 bit architecture, there're several others:

  • memory controller total limit
  • amount of RAM slots x MAX RAM module size
  • some memory management layer implementations like PAE (depends on CPU + OS) may even increase amount of total addressable virtual memory, but max.amount of physical memory remains the same.
  • marketing/software OS limitations (see section 2.5 for windows versions in the same wiki article);

The only info I've found on web states, Mac OS X Lion (not Server) has software limit of 64GB. The try of allocating more memory in one piece, than machine physically has hardly would be succeeded, though.

kirilloid
  • 14,011
  • 6
  • 38
  • 52
  • The 64Gb limit isn't quite correct. OS X client can (at least, and this is where it lacks suitable hardware to test this) address 96GB (tested in Mac Pro with 16GB modules). Personally, I see the 5500 chipset of the Mac Pro limiting the amount of addressable RAM, not the OS, though. – AlBirdie Apr 12 '12 at 14:35
  • This was an answer from some user, not an official info. Nevertheless, this doesn't actually mean, cause 64GB is more than size of that bitmap. – kirilloid Apr 12 '12 at 19:23
0

What kind of stuff do you want to save? Something generatively? I think you need to create a system where you use a fixed random seed, and build something view/create at low-res. You should be able to repeat the same motion. You probably have to save the (custom) motion to get to that point in a way too. If you have that you should apply a scale variable and render tile per tile to get around a big-ass canvas. This kind of system takes time to build and could still give some problems if the stuff that should be drawed is scaled too high.
As stated, for that kind of prints you don't need that high resolutions. Ofcourse beside that, it would be a challenge anyway to get those huge sizes.

Mark Knol
  • 9,663
  • 3
  • 29
  • 44