How to allocate a permanent memory?

Hai,
Is there any way to keep an object or a variable permanently in the memory such that I can access that object or variable's value using any other java program.
Regards
ackumar

So there is noway to allocate a permanentmemory.
Then i'll store it in a database.What's permanent memory? At least on my computerall
memory is permanent -:) What you want is shared
memory between processes. There are ways to getthat
but you need OS programming skills (using C) andbe
able to use JNI.It looks like the OP is ignoring you, or just reading
what he wants to see.I thought there'll be some direct solution in JAVA itself as if in C.
From our discussion I came to know we have to use either a file to store or "C and JNI".

Similar Messages

  • How to allocate memory and to get the start address

    im just trying to allocate a memory of 8MB and to get the start address of that mem,  by getting the address i will access that memory by dll function..  so i want to know how to allocate the memory and to get the address.. any one knows then pls tell me

    duplicate post
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Unable to expand permanent memory Error

    Hi everyone,
    When running the MIDlet I'm coding I get a java.lang.OutOfMemoryError with the fellowing message: "Unable to expand permanent memory".
    I tried to raise the heap size of the WTK emulator but no change. And what is more annoying is that the debugger won't step into the offending method.
    Do you have an idea on how to solve this problem.
    CU Jerome

    The runtime tells me that on a total of 512kb of memory 467kb are free.
    The offending method is initializing some arrays and populating them.
    CU Jerome

  • System.InsufficientMemoryException: Failed to allocate a managed memory buffer of 268435456 bytes. The amount of available memory may be low. --- System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

    Appfabric 1.1 server setup on 3 Windows server 2008 R2 machines.
    Client windows 7 64 bit.
    Because there is no bulkupdate ,we are trying to persist around 4000 objects wrapped in a CLR object.
     [Serializable]
        public class CacheableCollection<T> : ICacheable, IEnumerable<T>
            where T : class, ICacheable
            [DataMember]
            private Dictionary<string, T> _items;
            public IEnumerator<T> GetEnumerator()
                return _items.Values.GetEnumerator();
            IEnumerator IEnumerable.GetEnumerator()
                return _items.Values.GetEnumerator();
            [DataMember]
            public string CacheKey { get; private set; }
            public T this[string cacheKey] { get { return _items[cacheKey]; } }
            public CacheableCollection(string cacheKey, T[] items)
                if (string.IsNullOrWhiteSpace(cacheKey))
                    throw new ArgumentNullException("cacheKey", "Cache key not specified.");
                if (items == null || items.Length == 0)
                    throw new ArgumentNullException("items", "Collection items not specified.");
                this.CacheKey = cacheKey;
                _items = items.ToDictionary(p => p.CacheKey, p => p);
    We tried with the following options on server and client
    Server:
     <advancedProperties>
                <partitionStoreConnectionSettings leadHostManagement="false" />
                <securityProperties mode="None" protectionLevel="None">
                    <authorization>
                        <allow users="[email protected]" />
                        <allow users="[email protected]" />
                    </authorization>
                </securityProperties>
                <transportProperties maxBufferSize="500000000" />
            </advancedProperties>
    Client: 
     <transportProperties connectionBufferSize="131072" maxBufferPoolSize="500000000"
                           maxBufferSize="838860800" maxOutputDelay="2" channelInitializationTimeout="60000"
                           receiveTimeout="600000"/>
    I see different people experiencing different memory size issues. What is the actual memory limit of an  object that can be pushed to Appfabric. 
    Can some one please help ?
    Stack trace:
    Test method Anz.Cre.Pdc.Bootstrapper.Test.LoaderFuncCAOTest.AppFabPushAndRetrieveData threw exception: 
    System.InsufficientMemoryException: Failed to allocate a managed memory buffer of 268435456 bytes. The amount of available memory may be low. ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
    System.Runtime.Fx.AllocateByteArray(Int32 size)
    System.Runtime.Fx.AllocateByteArray(Int32 size)
    System.Runtime.InternalBufferManager.PooledBufferManager.TakeBuffer(Int32 bufferSize)
    System.Runtime.BufferedOutputStream.ToArray(Int32& bufferSize)
    System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message message, BufferManager bufferManager, Int32 initialOffset, Int32 maxSizeQuota)
    System.ServiceModel.Channels.BinaryMessageEncoderFactory.BinaryMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset)
    System.ServiceModel.Channels.FramingDuplexSessionChannel.EncodeMessage(Message message)
    System.ServiceModel.Channels.FramingDuplexSessionChannel.OnSendCore(Message message, TimeSpan timeout)
    System.ServiceModel.Channels.TransportDuplexSessionChannel.OnSend(Message message, TimeSpan timeout)
    System.ServiceModel.Channels.OutputChannel.Send(Message message, TimeSpan timeout)
    Microsoft.ApplicationServer.Caching.WcfClientChannel.SendMessage(EndpointID endpoint, Message message, TimeSpan timeout, WaitCallback callback, Object state, Boolean async)
    Microsoft.ApplicationServer.Caching.WcfClientChannel.Send(EndpointID endpoint, Message message, TimeSpan timeout)
    Microsoft.ApplicationServer.Caching.WcfClientChannel.Send(EndpointID endpoint, Message message)
    Microsoft.ApplicationServer.Caching.DRM.SendRequest(EndpointID address, RequestBody request)
    Microsoft.ApplicationServer.Caching.RequestBody.Send()
    Microsoft.ApplicationServer.Caching.DRM.SendToDestination(RequestBody request, Boolean recordRequest)
    Microsoft.ApplicationServer.Caching.DRM.ProcessRequest(RequestBody request, Boolean recordRequest)
    Microsoft.ApplicationServer.Caching.DRM.ProcessRequest(RequestBody request, Object session)
    Microsoft.ApplicationServer.Caching.RoutingClient.SendMsgAndWait(RequestBody reqMsg)
    Microsoft.ApplicationServer.Caching.DataCache.SendReceive(RequestBody reqMsg)
    Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg)
    Microsoft.ApplicationServer.Caching.DataCache.InternalPut(String key, Object value, DataCacheItemVersion oldVersion, TimeSpan timeout, DataCacheTag[] tags, String region)
    Microsoft.ApplicationServer.Caching.DataCache.Put(String key, Object value, String region)
    Anz.Cre.Pdc.DataCache.DataCacheAccess.Put[T](String cacheName, String regionName, T value) in C:\SVN\2.3_Drop3\app\Src\Anz.Cre.Pdc.DataCache\DataCacheAccess.cs: line 141
    Anz.Cre.Pdc.DataCache.DataCacheAccess.Put[T](String cacheName, String regionName, Boolean flushRegion, T value) in C:\SVN\2.3_Drop3\app\Src\Anz.Cre.Pdc.DataCache\DataCacheAccess.cs: line 372
    Anz.Cre.Pdc.Bootstrapper.Test.LoaderFuncCAOTest.AppFabPushAndRetrieveData() in C:\SVN\2.3_Drop3\app\Src\Anz.Cre.Pdc.Bootstrapper.Test\LoaderFuncCAOTest.cs: line 281

    Essentially what we are trying to do is the following.
    we have different kinds of objects in our baseline. Objects of type CAO, Exposures, Limits that change everyday after close of business day. 
    We wanted to push these different objects in to respective named regions in the cache. 
    Region Name     Objects
    CAO                   ienumerable<caos>
    Exposures           ienumerable<exposures>
    Limits                ienumerable<limits>
    we have a producer that pushes this data in to the cache and consumers of this data acting on the data when its available.
    Now the issue we are facing is when we try to push around 4000 cao objects (roughly in the size of 300MB when serialized using xml) ,we are getting the above error. Increasing the size on the client and cache cluster didnt help.
    The other alternative we were thinking about is chunking and pushing because appfabric doesnt support streaming. We might be able to push this data successfuly if we chunk. But how about the consumers ? wouldnt they face the same memory issue when we use
    getallobjectsinregion ?
    We thought if there was a way to figure out the keys in the region then probably the consumers can get one by one. However there is no such API. 
    The only option i see is using Appfabric notifications which msdn says isnt a reliable way.
    Please help.

  • How can we free the memory of array

    how can we refresh the memory of an array every time......if we want new values or fresh values each time.........becuase array index out of exception error is coming up and i want to deallocate the memory at the end of iteration or in the starting

    how can we refresh the memory of an array every
    time......if we want new values or fresh values each
    time.........becuase array index out of exception
    error is coming up and i want to deallocate the
    memory at the end of iteration or in the startingThis post consist of 95% gibberish. The only part that is not gibberish is "array index out of bounds exception" and that has nothing to do with memory at all.
    Please attempt to learn some basic Java before injuring yourself permanently.
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com . A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is
    the creator of Java. It doesn't get much more authoritative than this.

  • How to find CPU and Memory Utilization

    Hi,
    How to find CPU and Memory Utilization of my application which is
    running in solaris workstation.My application has a management console in which we need to update the cpu and memory periodically.
    (Notr : Usage of JNI is restrcited)
    Thnx and Rgds,
    Mohan

    There is no CPU usage API in Java. You need some JNI code. For memory usage see the Runtime methods:
         * Get information of memory usage: max, total, free and (available/used).
         * <ul>
         * <li>Max is the maximum amount of bytes the application can allocate (see also java options -Xmx). This value is fixed.
         * If the application tries to allocate more memory than Max, an OutOfMemoryError is thrown.
         * <li>Total is the amount of bytes currently allocated from the JVM for the application.
         * This value just increases (and doesn't decrease) up to the value of Max depending on the applications memory
         * requirements.
         * <li>Free is the amount of memory that once was occupied by the application but is given back to the JVM. This value
         * varies between 0 and Total.
         * <li>The used amount of memory is the memory currently allocated by the application. This value is always less or equal
         * to Total.
         * <li>The available amount of memory is the maximum number of bytes that can be allocated by the application (Max - used).
         * </ul>
         * In brief: used <= total <= max
         * <p>
         * The JVM can allocate up to 64MB (be default) system memory for the application. If more is required, the JVM has to be started with the Xmx option
         * (e.g. "java -Xmx128m" for 128 MB). The amount of currently allocated system memory is Total. As the JVM can't give back unallocated memory
         * to the operating system, Total can just increase (up to Max).
         * @return Memory info.
        static public String getMemoryInfo() {
            StringBuilder sb = new StringBuilder();
            sb.append("Used: ");
            sb.append(toMemoryFormat(getUsedMemory()));
            sb.append(", Available: ");
            sb.append(toMemoryFormat(getAvailableMemory()));
            sb.append(" (Max: ");
            sb.append(toMemoryFormat(Runtime.getRuntime().maxMemory()));
            sb.append(", Total: ");
            sb.append(toMemoryFormat(Runtime.getRuntime().totalMemory()));
            sb.append(", Free: ");
            sb.append(toMemoryFormat(Runtime.getRuntime().freeMemory()));
            sb.append(")");
            return sb.toString();
        }//getMemoryInfo()

  • How do I get my memory back if I just restored it?

    How do I get my memory back if I just restored it?

    delgado555 wrote:
    How do I get my memory back if I just restored it?
    Your question is unclear...

  • How do i get more memory on my mac book air? is says that i can add 2 more gig how?

    how do i get more memory on my mac book air? is says that i can add 2 more gig ??? or wat files can i delete

    Macbook Air memory is soldered to the logicboard.
    You can only get 4GB or 8GB (2012 Models) in the Air when you order it that way.  Otherwise, you're stuck with 2GB.
    Unless you're talking about hard drive space - then it is upgradeable - click HERE to see which one corresponds to your model.

  • How do i get more memory installed on my macbook air

    How do i get more memory installed on my macbook air

    If you are referring to RAM, the Air's RAM is not an upgradeable component. The RAM memory is soldered to the main board, and there are no expansion slots.
    It is the price Air owners pay for miniaturization. Every Air is manufactured with all the memory it will ever have. Shop wisely.
    It is technically possible to upgrade the SSD storage though, but will probably void any warranty.

  • How do I get more memory on my IMAC .I have 1 GIG and to run LION you need 2 GIGS?

    How do I get more memory on my IMAC .I have 1 GIG and to run LION you need 2 GIGS?

    Depends on the Mac; what model and processor is it?
     > 'about this Mac' > 'more info'
    In the first section (hardware overview) post this info;
    Nothing below that is reqd, especially not the serial number.

  • How do you add more memory to a macbook circa 2007

    how do you add memory to a macbook mid-2007?

    >If you have a Mid 2007 MacBook, that can use up to 3GB RAM.
    Since that model can use an odd number RAM capacity upgrade, with
    a total of 3GB between two memory slot locations, you could put one
    piece of RAM of 1-GB in a slot, and in the other, a 2-GB RAM chip...
    Maximum Memory:    3.0 GB (Actual) 2.0 GB (Apple)
    Memory Slots:    2 - 200-pin PC2-5300 (667MHz) DDR2 SO-DIMM
    •MacBook: How to remove or install memory
    >If you have a Late 2007 MacBook, that can use up to 6GB RAM:
    Maximum Memory:    6.0 GB (Actual) 4.0 GB (Apple)
    Memory Slots:    2 - 200-pin PC2-5300 (667MHz) DDR2 SO-DIMM
    Recommendations have been to check the spec and model computer
    against the on-site parts suggestions for the computer model identifier
    at OWC macsales.com, or check into Crucial.com for specific match
    based on their information. OWC tends to be an easier way if you know
    the MacBook model identifier, and if yours actually is the Mid-2007 vs
    another different one. The Late-2007 can use up to 6GB RAM.
    •The identifiers for Mid-2007 MacBook 13-inch:
    Introduced    May 2007
    Discontinued    November 2007
    Model Identifier    MacBook2,1
    Model Number    A1181
    EMC    2139
    Order Number    MB061LL/A (White), MB062LL/A (White), MB063LL/A (Black)
    •The identifiers for Late-2007 MacBook 13-inch:
    Introduced    November 2007
    Discontinued    February 2008
    Model Identifier    MacBook3,1
    Model Number    A1181
    EMC    2200
    Order Number    MB061LL/B (White), MB062LL/B (White), MB063LL/B (Black)
    {as you may notice, some identification numbers are recycled; for confusion sake}
    Hopefully this helps somewhat.
    Good luck & happy computing!
    edited

  • How do i install more memory in my macbook air? it only has 4GB

    How can i install more memory in my macbook air? it has 4GB only and it keeps telling me my start up disk is full.

    Welcome to the Apple Support Communities
    In the case of the MacBook Pro with Retina display and the MacBook Air, memory is soldered into the logic board, so you can't add more memory after buying the MacBook.
    However, memory isn't your problem. One thing is the memory and another thing is the hard drive, and you are running out of space in the hard drive, not in memory.
    To fix this, just delete files that you don't need, or move them to an external drive, in order to make free space on your MacBook

  • How can I add more memory to my iPad?

    How can I add more memory to my iPad?

    Memory refers to RAM, and can't be increased.
    I asume you mean storege space (like 16GB, 32GB, etc). It also can't be increased.
    There are some wireless external hard drives that can be used with the iPad.
    The Kingston Wi-Drive, which costs $50 for the 16 Gigabyte, and then $30 more for every 16 gigs more. It works by you turning it on and then accessing the files on it from an app that you download on your iDevice. You can access music, movies, and other stuff. No connections or anything, it works like a WiFi connection, you connect to it from the setting on the iPad under wireless networks.
    Then there is the Seagate GoFlex, which some would recommend over the Wi-Drive. But this one costs $199 and had 500 Gigabytes of storage. It works the sameway as the Kingston: no wires, runs over its wireless connection. You can actually fit up to 300 HD movies on it.
    Another option:
    Expand your iPad's storage capacity with HyperDrive
    http://www.macworld.com/article/1153935/hyperdrive.html
    On the road with a camera, an iPad, and a Hyperdrive
    http://www.macworld.com/article/1160231/ipadhyperdrive.html
     Cheers, Tom

  • How can I add more memory to my iPod touch

    How can I add more memory to my iPod touch?

    You are not able to add memory to a iPod Touch.
    The only way to get more memory is to buy one with a larger capacity.

  • How do I add more Memory to the 2 open slots in my iMac - it is 4GB now

    How do I add more Memory to the 2 open slots in my iMac ???  It is 4GB now and I get the spinning beach ball often when several Apps are running.
    Does the Apple Store sell and install???
    Please advise if you have upgraded your iMac memory

    Go to a website such as OWC or Crucial's, determine which type of RAM your computer needs, and buy it from that site. They provide installation instructions on the site.
    (115474)

Maybe you are looking for