I wrote a small app to test (which i will paste the main below) but so
the problem seems to be machine specific.
I have a windows 2003x64 VM (vmware) with 4 GB ram and when I run this
program it will consistently fail at 31MB of data.

On any non virtual machine I have run it on it will go past that 31MB
limit

Anyone have any ideas?
Thanks

----- Main.cs
namespace MaximumOfflineDataSize {
        using System.IO;
        using System;

        using Rhino.PersistentHashTable;

        class Program {
                static void Main(string[] args) {
                        log4net.Config.XmlConfigurator.Configure();
                        var output = log4net.LogManager.GetLogger(typeof 
(Program));

                        var sizeInMB = 1;
                        var maxSizeInMB = 2;

                        /*
                         * Arguments:
                         * If 1 argument then it is the max size
                         * If 2 arguments then the first is the start and the 
2nd is the
max
                         */

                        if(args.Length == 2)
                        {
                                sizeInMB = Convert.ToInt32(args[0]);
                                maxSizeInMB = Convert.ToInt32(args[1]);
                        }
                        else if(args.Length == 1)
                        {
                                maxSizeInMB = Convert.ToInt32(args[0]);
                        }

                        if(Directory.Exists("test.cache"))
                        {
                                Directory.Delete("test.cache", true);
                        }

                        var pht = new PersistentHashTable("test.cache");
                        pht.Initialize();
                        output.Info("Created PHT");

                        while(sizeInMB <= maxSizeInMB)
                        {
                                var data = CreateDataArray(sizeInMB);

                                try
                                {
                                        pht.Batch(actions =>
                                        {
                                                actions.Put(new PutRequest()
                                                {
                                                        Key = 
"test-data-"+sizeInMB,
                                                        Bytes = data,
                                                        ParentVersions = new 
ValueVersion[0]
                                                });

                                                actions.Commit();
                                        });

                                        output.InfoFormat("Successfully wrote 
data of {0} MB", sizeInMB);
                                }
                                catch (Exception ex)
                                {
                                        output.InfoFormat("Failed to write data 
of size {0} MB",
sizeInMB);
                                        output.Info("Error was", ex);
                                        break;
                                }
                                finally
                                {
                                        sizeInMB += 1;
                                        data = null;
                                }
                        }

                        Console.WriteLine("Finished, Press [ENTER] to quit");
                        Console.ReadLine();
                }

                static byte[] CreateDataArray(int sizeInMB)
                {
                        return new byte[sizeInMB*1000000];
                }

        }
}

On Aug 5, 9:09 pm, Ayende Rahien <[email protected]> wrote:
> It should be possible to put up to 2GB, can you create a test case?
>
>
>
> On Thu, Aug 6, 2009 at 4:44 AM, Chris Ortman <[email protected]> wrote:
>
> > Has any one run into any size limitations when putting data into the
> > pht? I am trying to do a put with 37 mb of data and geTting event out
> > of memory errors
>
> > --
> > Sent from my mobile device
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to