Question: Good afternoon,

I am passing a JSON string to an iOS app and an Android app from a webservice. Business rules dictate that this JSON string CAN contain data with a quotation mark. 

```
{"message": [{"MessageID": "22", "CompanyID": "0897001", "MessageText": "this "message" has quotes", "JobID": "BT201-Main-1-031508-134700", "AttachmentCount": "0", "MainDevice": "1"},{"MessageID": "23", "CompanyID": "0897001", "MessageText": "this message has  no quotes", "JobID": "BT201-Main-1-031508-134700", "AttachmentCount": "0", "MainDevice": "1"}]}

```

After doing a little google-ing, I have found that if I want to send data with quotation marks enclosed, I just need to preface the quotation marks inside of the value with a backslash:

```
{"MessageID": "22", "CompanyID": "0897001", "MessageText": "this \"message\" has quotes", "JobID": "BT201-Main-1-031508-134700", "AttachmentCount": "0", "MainDevice": "1"}

```

When the android app gets this JSON, it parses it beautifully. The data displays in the view with quotes and all. Not so with the iOS app. What can I do to the JSON to get the iOS app to properly parse the JSON? I am currently using SBJSON in my iOS app. Any help would be greatly appreciated. Thanks!

Answer: 
This issue is not with collections in general, and *not* with the `LinkedList` as shown (which has `O(1)` adding characteristics).

The likely suspect is thus thrashing/swap of memory. *Make sure the JVM has enough memory, and the system has more ..*

Switching from `LinkedList` to `ArrayList` (or `ArrayDeque`) will keep `O(1)` *amortized* performance, but **may** have *slightly* less overhead per-item. (The overhead, and if such a reduction would even matter, depends upon the size of the objects added and the fill ratios of the backing stores.)
* ArrayList has already been suggested (in a linked list, each item/node implies an additional object).
* Also (previously suggested as well), if you use an array-based collection, try to construct/resize into an adequate length.
* Also, if memory is an issue, you might want to use the Flyweight pattern with the string elements `String#intern()`, so redundant instances can be collected.