out of memory with SIXX

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

out of memory with SIXX

Max Leske
Hi

I'm sure this is a standard n00b question; sorry in advance.

I'm trying to load an existing database into GemStone with SIXX. I found the post on GemStone 101 that explained about handling this sort of problem so I'm using the code from that post:

| commitThreshold reader |
commitThreshold :=  75.
"Install AlmostOutOfMemory handler"
Exception
  category: GemStoneError
  number: (ErrorSymbols at: #rtErrSignalAlmostOutOfMemory)
  do: [:ex :cat :num :args |
      "Exception caught, do a commit."
      System commitTransaction 
          ifFalse: [ nil error: 'AutoCommit failed' ].
      "run a markSweep"
      System _vmMarkSweep.
      (System _tempObjSpacePercentUsedLastMark <
                commitThreshold)
          ifTrue: [
            "We dropped below the threshold,
             reenable the signal"
            System enableAlmostOutOfMemoryError ].
      "continue execution" ].
"Enable AlmostOutOfMemory signal"
System signalAlmostOutOfMemoryThreshold: commitThreshold.
[ reader := SixxReadStream basicNew.
(System myUserProfile resolveSymbol: #CTM) value at: #CTMDB put: reader.
System commitTransaction.
reader readOnlyFileNamed: '../testDB' ]
    ensure: [
        "disable AlmostOutOfMemory signal"
        System signalAlmostOutOfMemoryThreshold: -1].

What I try to accomplish here is to load the entire database (SIXX doesn't leave me much choice there; 40MB). The blog post said that the "datastructure" needs to be persistent so I try to persist the objects already read by putting the SIXX object into a private dictionary.

Anyway, everything I've tried leads to an out of memory situation. Can anyone give me a hint here?

Thanks,
Max
Reply | Threaded
Open this post in threaded view
|

Re: out of memory with SIXX

NorbertHartl
Max,

you could try the utility I announced 5 days ago on this list. Look for "[ANN] Utility for Sixx handling". You'll find there a way how to do it with a persistent object. 

Norbert

On 23.02.2011, at 11:41, Max Leske wrote:

Hi

I'm sure this is a standard n00b question; sorry in advance.

I'm trying to load an existing database into GemStone with SIXX. I found the post on GemStone 101 that explained about handling this sort of problem so I'm using the code from that post:

| commitThreshold reader |
commitThreshold :=  75.
"Install AlmostOutOfMemory handler"
Exception
  category: GemStoneError
  number: (ErrorSymbols at: #rtErrSignalAlmostOutOfMemory)
  do: [:ex :cat :num :args |
      "Exception caught, do a commit."
      System commitTransaction 
          ifFalse: [ nil error: 'AutoCommit failed' ].
      "run a markSweep"
      System _vmMarkSweep.
      (System _tempObjSpacePercentUsedLastMark <
                commitThreshold)
          ifTrue: [
            "We dropped below the threshold,
             reenable the signal"
            System enableAlmostOutOfMemoryError ].
      "continue execution" ].
"Enable AlmostOutOfMemory signal"
System signalAlmostOutOfMemoryThreshold: commitThreshold.
[ reader := SixxReadStream basicNew.
(System myUserProfile resolveSymbol: #CTM) value at: #CTMDB put: reader.
System commitTransaction.
reader readOnlyFileNamed: '../testDB' ]
    ensure: [
        "disable AlmostOutOfMemory signal"
        System signalAlmostOutOfMemoryThreshold: -1].

What I try to accomplish here is to load the entire database (SIXX doesn't leave me much choice there; 40MB). The blog post said that the "datastructure" needs to be persistent so I try to persist the objects already read by putting the SIXX object into a private dictionary.

Anyway, everything I've tried leads to an out of memory situation. Can anyone give me a hint here?

Thanks,
Max

Reply | Threaded
Open this post in threaded view
|

Re: out of memory with SIXX

Max Leske
Wicked! I'll give it a try tomorrow.

Thanks!

Max


On 23.02.2011, at 11:51, Norbert Hartl wrote:

Max,

you could try the utility I announced 5 days ago on this list. Look for "[ANN] Utility for Sixx handling". You'll find there a way how to do it with a persistent object. 

Norbert

On 23.02.2011, at 11:41, Max Leske wrote:

Hi

I'm sure this is a standard n00b question; sorry in advance.

I'm trying to load an existing database into GemStone with SIXX. I found the post on GemStone 101 that explained about handling this sort of problem so I'm using the code from that post:

| commitThreshold reader |
commitThreshold :=  75.
"Install AlmostOutOfMemory handler"
Exception
  category: GemStoneError
  number: (ErrorSymbols at: #rtErrSignalAlmostOutOfMemory)
  do: [:ex :cat :num :args |
      "Exception caught, do a commit."
      System commitTransaction 
          ifFalse: [ nil error: 'AutoCommit failed' ].
      "run a markSweep"
      System _vmMarkSweep.
      (System _tempObjSpacePercentUsedLastMark <
                commitThreshold)
          ifTrue: [
            "We dropped below the threshold,
             reenable the signal"
            System enableAlmostOutOfMemoryError ].
      "continue execution" ].
"Enable AlmostOutOfMemory signal"
System signalAlmostOutOfMemoryThreshold: commitThreshold.
[ reader := SixxReadStream basicNew.
(System myUserProfile resolveSymbol: #CTM) value at: #CTMDB put: reader.
System commitTransaction.
reader readOnlyFileNamed: '../testDB' ]
    ensure: [
        "disable AlmostOutOfMemory signal"
        System signalAlmostOutOfMemoryThreshold: -1].

What I try to accomplish here is to load the entire database (SIXX doesn't leave me much choice there; 40MB). The blog post said that the "datastructure" needs to be persistent so I try to persist the objects already read by putting the SIXX object into a private dictionary.

Anyway, everything I've tried leads to an out of memory situation. Can anyone give me a hint here?

Thanks,
Max