Will XML Help?

I am loading a nice amount of
data onto a server from a db
so that clients can have quick
access to the info (we wont
have to go back to the db to
get their info). As the data is
growing I am getting an Out
Of Memory error. Do you think
that if I store the info in XML
instead of Objects that it will
take up less memory?

Lets give an example:
public class A{//The class being cached
  public String[] s;//The content of the class
public class DataSomething{//From here you fetch you data, either by fetching cached result or getting it from database
  A[] allAs;//all As are cached here
  Hashtable cachedStrings;//Store all strings here
  public DataSomething(DatabaseConnection _db){//Initilise by getting all values from the database
    //Fetch all data from the database and store in allAs
    int nrAs=_db.getNrRows();//There is no class called DatabaseConnection, it's just imaginary calls
    for(int i=0; i<nrAs; i++){
      A a=(A)_db.get(i);//fetch it from _db
      //Now replace the strings in a by cached strings
      for(int j=0; j<a.s.length; j++){
        String cachedString=(String)cachedStrings.get(a.s[j]);
        if(cachedString==null){//First instance of this string - store it in the cachedStrings
          cachedStrings.put(a.s[j],a.s[j]);
        )else{//Let go of the reference of the string found in the database, and instead refer to an equal instance, already taking up space in memory
          a.s[j]=cachedString;
  public A get(int nr){//someone wishes to get the A numbered 'nr'
    return allAs[nr];
}In the initialisation of the class, all A-objects has references to strings, so the parts are held together by the A-objects. But they just refer to the same instances of strings.
Gil

Similar Messages

  • Having problems with Verizon iPhone 5 using excessive data. Verizon will not help can anyone give me advice? Have family plan never went over 8gb of data in 6 years, now avg 14 a month and are not using anything different other than having iPhone 5.

    Switched to iPhone 5 on July 31st.  Since then our data usage has doubled.  Verizon will not help find out what the problem could be, they claim they are unaware of a problem.  I told them to look on the customer support page and many have complained about the problem.  Now on the apple site I see it may be an apple problem.  Some one needs to fix this.  Apple you want us to use your products, please do t make it cost us more money just to do what we did prior without problems.  Prior phones were iPhone 4 and we never had issues and never went over 8 gb's for 4 phones.  Now we are doing 14.  Can anyone tell me what is going on.  Getting ready to stop using cell phones all together.

    Well you could Restore it from your backup and see if that helps. If it doesn't Restore it as new and manually add things back until the problem starts again.
    I would also suggest trying a different SIM.
    Without iOS 7 there is no way to isolate what is using the data.

  • My email address got into hundreds of solicitors.  I now have 703 emails from all sorts of businesses.  Apple will not help since I am not signed up with their $79 support I cannot afford more bills.  Can someone tell me how to stop this, not unsubscribe

    How do I delete and stop all of the unwanted 702 emails that are coming into my acct on my iPad. Sure there are more coming now.
    Frontier will not help unless I agree to a costly protection.  Apple says I have to have their extra contract or pay for a one-time fee.
    I cannot use my acct on my iPad this way.

    Not something I would suspect Apple could help with. The most obvious solution is to,change your email address. You might also check with your email provider and see if there an any anti-spam settings on the server that would help.

  • Will Apple help us with ATT rate hikes? Who do I contact?

    Just a few months ago - and at the time I entered into my 2 year contract - unlimited textings was avaialble for less that 5 dollars more. But that is now gone and what has taken its place is just Dick Channey crazy!
    Wasnt the whole point of APPLE insisting that phone plans all come with unlimited internet so that this would encourage the owners to fully integrate the iphone in to their daily lives? Does having huge rate increases in texting help that cause ?
    MY QUESTION TO APPLE and its user forums - WHO do I contact at apple or at ATT for help on this issue??
    Thats what I want in a nutshell. If you want, I can tell ya more.
    Harry
    iphone, ipod and shuffle owner
    MORE is this...........................
    I do understand the nature of big business and partnerships etc.
    I do understand that Apple would like to not be involved in disputes between ATT and its customers.
    I GET THAT. But can Apple help me anyway just for the reason that I WANT TO KEEP MY IPHONE?!?!?
    ATT has implemented monsterous rate hikes and LIMITATIONS on package combinations so that iphone users will pay as much or more for Texting than they do for unlimited internet.
    We had to live with unlimited internet not including unlimited texting. OK fine, thats how it was when we signed up and you have to take it or leave it. But now with the new changes in rates - here is what the iphone user has as their options.
    200 included texts for free
    or
    $5 - get 200 more - 400 texts total
    or
    THE NEXT OPTION - $20 MORE, for not unlimited but 1500 texts.
    Does having to keep an eye on your text totals or paying at least $85 / month sound like the vision that apple wanted for the iphone users?
    if it doesnt, WILL YOU HELP US?

    I didnt forget that - its I dont know that statement to be true.
    I have been with ATT since Cingular and I've had internet,text and MMS combo packages for some time now; that Includes shopping around for the right phone and plans combo. And I know for a fact that there were MANY combos of unlimited and they were FAR from 50 bucks.
    There certainly might be a webpage or two with some ancient pricing plans offered. And I am sure that any one of those would be superceeded by another new price offer on the same plan.
    so I didnt forget that; I knew it to be not on point.

  • My daughters ipod touch is disabled because of a wrong passcode.  I have tried many times to log onto to Itunes and it will not help without a passcode and is not recognizing the itouch as a device, but the USB is functional.  Do I need Itunes to fix this

    My daughters ipod touch has been disabled because of a wrong passcode.  After 2 days of trying to get into Itunes, it will not help without a passcode and is not recognizing it as a device even though the computer is recognizing the USB.  I know I have to do a complete recovery, but can I do this without Itunes (or Icloud)?

    You cannot do this without itunes on your computer

  • If I buy a new macbook with Apple, will they help me install a dual operating system?

    I've heard Bootcamp does this, but I've never owned a Mac before, and am daunted by the change. I would love a Mac for ease of use, as many of my friends seem to love it, but for school purposes, my PC laptop is better. My PC needs to be updated, though, and I really want to spring for the Mac, I just don't want to lose being able to not have to do my homework in a computer lab. A friend has dual operating systems on hers, and says it works beautifully for running both, though I don't know what macbook she's got. If I go to an Apple store and get a laptop from them, even bring the Windows 7 operating system (I'm NOT doing Windows 8), will they help do this for me? Does anyone know if it is alright to have the dual systems, or if it takes away from the hardware's ability to work? ANY advice is welcome.

    It  is not hard. Boot Camp allows running Windows natively, same as on a laptop PC would be with a few differences in fan and thermal control and drivers.
    Once installed natively which would be dual-boot setup, you can then install and use VMware or Parallels to assign the Windows partition for use as a VM inside OS X, no more need to dual boot unless you want to.
    All of the information can be printed out from Boot Camp Assistant utility, or from the support help page and link to the manual:
    http://www.apple.com/support/bootcamp
      Paragon CampTune is a commercial product that is designed expressly for this task. http://www.paragon-software.com/home/camptune/ It consists of a downloadable ISO that needs to be burned to a disc and booted from in order to resize the partitions costs US$19.95.
    Mac 101: Using Windows on your Mac via Boot Camp
    https://support.apple.com/kb/HT1461
    http://www.apple.com/support/bootcamp/
    Helpful Apple Support Resources (Forum Overview)
    Boot Camp Support 
    Boot Camp Manuals
    Frequently asked question
    http://support.apple.com/kb/HT4818
    Older Lion version for the manual:
    http://manuals.info.apple.com/en_US/boot_camp_install-setup_10.7.pdf

  • After updating to Firefox 4, I have lost 4 plugins/add ons due to their NOT being compatible. I can no longer play my bejewelled game. Please help me here. Can I get Firefx 3.6 back? Will that help me?

    Firefox 3.6 allowed me to play games, Firefox 4 upgrade doesn't.Question
    After updating to Firefox 4, I have lost 4 plugins/add ons due to their NOT being compatible. I can no longer play my bejewelled game. Please help me here. Can I get Firefx 3.6 back? Will that help me?

    http://support.mozilla.com/en-US/kb/Installing+a+previous+version+of+Firefox
    http://www.mozilla.com/en-US/firefox/all-older.html

  • Will Apple help me with this issue?

    Dear Sir or Madam,
    I am a student in China, I really need your help, my iphone now problems bothers me! HELP ME PLEASE!!!
    As I bought my iPhone 4s(16GB,White) in the USA from Sprint, full price with tax,  unlocked ,it was excepted to be a global phone. But now I come across with some problems in China  using local carrier.Now I am in China, not the normal use of the phone, I rely on odd jobs to earn, very not easy, English is not my mother tongue, maybe there are many grammatical mistakes, I hope you'll forgive me! Mobile phone can not be used normally I am very sad, I can not contact the parents and friends, can not let them worry about me, I've tried all means, including the upgrade to 6.1, but still can not solve the problem, I think maybe I am in China, so can not be used normally, at this moment I am very anxious, because of the time difference, it is later I can send mail, you can see it, please help me, a Chinese student's request!
    I tried all the possible solutions from the Internet, and the Official solution offered by Apple (http://support.apple.com/kb/TS4459), but it doesn't seem to work.
    Will Apple help me with this issue? Please do.THANK YOU VERY MUCH!!!

    We are not Apple, and Apple does not unlock phones. Sprint will unlock phones, but you have to qualify. One of the qualifications is to have been a customer in good standing for a period of time. You can check their website for what that is. After that, they can unlock the GSM side of the phone for International use, that is it. If you are on a CDMA carrier, then it cannot be unlocked. Are you trying to use a local SIM card in China?
    Your only option is to contact Sprint to see if you qualify for an unlock. Only they can unlock it. Sprint is one of the poorest choices to take to another country.

  • My mom shut of siri in the restritions, but then she turned it back on. the problem is that no matter how many times i shut off my phone and turn it back on, it still has voice control on. Will someone help me.

    My mom shut of Siri in the restrictions, but then she turned it back on, the problem is no matter how many times i turn my phone on and off, it still has voice control. Will someone help me?

    When Siri is OFF, Voice control is automatically ON

  • I need to install an adobe camera raw plug in into my elements 11 ... will you help?

    I need help on how to install adobe camera raw into my elements 11  will you help me please?

    Direct download links for Camera Raw 7.4:
    Camera Raw 7.4 Macintosh
    Camera Raw 7.4 Windows

  • I'm trying to up grade the os but I keep getting the startup disk is full I ordered more memory I was told this will not help. What do I do?

    I'm trying to up grade the os but I keep getting the startup disk is full I ordered more memory I was told this will not help. What do I do?

    I think as drive capacities increase, the old 10-15% becomes less accurate.  The amount of free space you need doesn't really have anything to do with the drive size.  So, increasing your drive size shouldn't mean that you need to have more free GB (which using a % of drive space would mean).  You need free space to accommodate page outs (the amount of which would depend on how much RAM you have installed and how memory intensive the applications are), sleep images (again, this would max out at your total amount of RAM), and a bit to minimize fragmentation.
    With desktop drives commonly in the 2TB range today, it is certainly not necessary to have 200GB+ free in order to maintain proper operation.  I generally find about 30GB to be the minimum I'm comfortable with.  Mind you, I pretty much always have way more than that available.  But, if I'm working on a system and the amount of free space is at least 30GB, I would generally not site drive space as the cause of any performance issues.  I'd say that 30GB is a minimum for a stable system (with 8GB or RAM installed).  Of course at that amount, you would still need to free up space if you were to want to install or download any significant amount of data.
    With servers being more likely to run into the 16GB of RAM range, more storage would be necessary.  Most servers should be well stocked with storage, but the actual needs would vary greatly depending on what's being "served".
    The 10-15% thing came about when we used to talk about drive capacities in hundreds of MBs and RAM in terms of KB (not MB and certainly not GB).  More drive space is always a good thing, but as drive capacities continue to sky rocket, we don't need to dedicate larger amounts of storage on systems with the same specifications.  A set amount of space is required for proper operation regardless of the capacity of the drive installed.

  • I've been using Adobe Acrobat 7 for many years. I updated my full version of Acrobat 5 to get to 7. My hard drive crashed and I've been trying to reinstall Acrobat and it will not install. Adobe will not help because 7 is no longer supported. Does anyone

    I've been using Adobe Acrobat 7 for many years. I updated my full version of Acrobat 5 to get to 7. My hard drive crashed and I've been trying to reinstall Acrobat and it will not install. Adobe will not help because 7 is no longer supported. Does anyone know where I can go for help?

    You won't be able to install your original Acrobat 7 at all, or use your original serial number. The server which used to allow this was switched off.
    But assuming you have a compatible system, like Mac OS 5 or Windows XP, licensed users of Acrobat 7 can download a replacement and get a replacement serial number.
    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3

  • Error 999 is shutting down my yahoo mail, someone suggested I "upgrade my Adobe"will this help and w

    Error 999 is shutting down my yahoo mail, someone suggested I "upgrade my Adobe"will this help and whaat should I do?
    E-mail me [email protected]

    Your suggestion of breaking up the export to pdf into sections of pages was excellent. I don't know why I didn't think of it...maybe because I was in panic mode.
    For anyone else who experiences this problem, I exported 50-page sections to pdf with no problem. I now have 7 hi-res pdfs, but that's no problem. The printer should have no problem dealing with it. No error messages came up.
    The only thing I can think of is that InDesign couldn't export that many documents (148) in the book palette to hi-res pdf, and it has no error message available to explain the cause—either outside ID's ability to process or out of memory, even though I have 16G of RAM.
    Thanks again for your help!

  • My macbook air with snow leopard OS. migrated to OS lion and have installed Java RE. a Bank website while opening in Java shows one error which window activity shows some applets not opening. it was fine in snow leopard. will somebody help?

    My macbook air with snow leopard OS was purchased last year. Recently migrated to OS lion and have also installed Java RE. A Bank website while opening in Java shows one error which window activity shows some applets not opening. But it was fine in snow leopard. Will somebody help?

    My macbook air with snow leopard OS was purchased last year. Recently migrated to OS lion and have also installed Java RE. A Bank website while opening in Java shows one error which window activity shows some applets not opening. But it was fine in snow leopard. Will somebody help?

  • HT4946 My sound is not working for Siri, voice mail, Itunes,and ringer tones... the only sound that works is the buzzer. I was told at Verizin to try and update my I tune app off my Home computer and that might make the sound , will this help or is the sp

    Sound is not working for Siri, voice mail, ringer tones, movies or music. I was told by verizon that the speaker maybe out, but that i might want to try and reload or update my itunes by plgging into my home computer... will this help and if so how do I do this?

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

Maybe you are looking for

  • Can I see my presenter's notes

    Can I see my presenter's notes on my MBP during the presentation whereas they are not visible on the screen for the audience

  • Script Logic to Calculate average or sum based on parent member involving

    Hi ! freinds, I am trying to write script logic to calclate sum  of previous 2 months for  one group account having 100 childrens and write to DIFFERENT INPUT ACCOUNT . Please suggest the best practive to calculate the value. I tried with : *WHEN *IS

  • How to backup or archive a particular Container or Library?

    Hi, Is there a way to export a library or container such that it can use as a form of backup for recovery later in a disaster or to move to another server (eg. dev instance) ?? Thanks Steve

  • Application Security Preferences

    I just updated Open Office and now get an error message telling me I can't open it b/c it wasn't downloaded from the app store. This only started happening since upgrading to Mountain Lion. I can't seem to figure out the appropriate action in System

  • Getting ORA-19011 while executing deleteXML - please help

    Hello, I try to execute a deleteXML query of the following format: UPDATE MyTableName SET OBJECT_VALUE = deleteXML(OBJECT_VALUE, '/RootNode/Property[@type="MyPropertyType"]/Entry[contains(./text(), "myTextToFind")]') WHERE existsNode(OBJECT_VALUE,'/R