7

How much data (As in size) can be stored in a Javascript array? All of my data are float values. I am trying to cache all of the data that server sent to web app client in array first and then read it from that array every second to render it in plot. This way I will render multiple points at a time and won't have to rend a point every time new data point arrives (which is actually every 20ms)

Please suggest.

Mils
  • 1,479
  • 3
  • 19
  • 42
Andy897
  • 6,915
  • 11
  • 51
  • 86
  • Did you see this:: http://stackoverflow.com/questions/6154989/maximum-size-of-an-array-in-javascript – Sudhir Bastakoti Oct 07 '12 at 05:24
  • 2
    When you never accept answers, it limits the number of people that will even bother writing an answer. Why help someone out if they won't even acknowledge it? – Rhyono Oct 07 '12 at 05:28

2 Answers2

5

The exact maximum limit of an array is 2^32 - 1 or 4294967295, due to restrictions in Javascript's memory. The number of items, also known as the length property, cannot be greater than that. Check this: http://4umi.com/web/javascript/array.php for more details.

Mils
  • 1,479
  • 3
  • 19
  • 42
  • Just adding, `Float32Array` has a maximum length of `2^29-2` on my 32-bit machine. P.S. Does anyone have a clue why that number? – Robbie Wxyz Nov 27 '13 at 03:19
3

as the size of integer data type, because length property is of integer data type, it cannot be greater than that. i.e.2^32

Ravindra Bagale
  • 17,226
  • 9
  • 43
  • 70