[sugar] Using Git / downloading activities and Memory problems

Reinier Heeres reinier at heeres.eu
Fri Jun 22 17:49:23 EDT 2007


Hi Yeong,

Looks to me you're trying to use 26 * 800 * 400 * 3 = 25MB of memory; 
this might be the problem. Do you really need to have all those images 
in memory at the same time?
(btw, black and white images likely reduce the factor 3 in the equation 
to 1/8, so then you shouldn't have a problem).

Cheers,
Reinier

Yeong Haur Kok wrote:
> Hi Ivan,
>  
> > are preloading an array of 26 images ~32K each and this crashes on the
> > olpc.
>
> Please provide more details. Memory allocation shouldn't *crash* the
> machine under any (reasonable set of) circumstances; the OOM killer
> might kick in and destroy a few processes, however. In your case, you're
> allocating less than a meg, so something is certainly wrong if it's
> crashing. What kind of crash are you getting? Can you post the code and
> the images somewhere where we can test this?
> The program runs when images are scaled to 600 x 250 (using the gtk 
> scale_simple function) or smaller. When we try to scale up to larger 
> dimensions - e.g. 800 x 400 - it crashes. The application simply exits 
> on it own.
>  
> I tried replacing the images (to be loaded into the array) with 
> smaller size (~19k) black and white images and the program runs 
> alright. But when these are replaced with color images of similar 
> size, the same problem occurs.
>
> Here's the relevant part of code, KEY_X and KEY_Y are the image 
> dimensions we're trying to scale up (default 600 x 250):
>  
>  
>         self.dict_pixbuf = {}
>         alphastring = "abcdefghijklmnopqrstuvwxyz"
>        
>         for i in range(len(alphastring)):
>             letter = alphastring[i]
>             self.dict_pixbuf[letter] = 
> gtk.gdk.pixbuf_new_from_file(IMAGE_SOURCE + os.sep + "keypress" + 
> os.sep + letter.upper() + ".gif").scale_simple(KEY_X, KEY_Y, 
> gtk.gdk.INTERP_BILINEAR)
>  
> Any suggestions would be appreciated! Thanks!
>  
>  
> yh
>  
> On 6/22/07, *Ivan Krstić* <krstic at solarsail.hcs.harvard.edu 
> <mailto:krstic at solarsail.hcs.harvard.edu>> wrote:
>
>     Hi Aneto,
>
>     Aneto Okonkwo wrote:
>     > I have been having difficulty installing git on windows.  Does
>     anyone
>     > have any instructions I can use to download and set it up?
>
>     Git still relies on a mudball of shell and Perl scripts, so getting it
>     running under Windows proper is an uphill battle. The recommended
>     way to
>     do it is to first set up Cygwin, which might be more trouble than
>     you're
>     willing to go through. Even then, it'll run quite slowly because of
>     certain FS ops being substantially slower on Windows than on Linux.
>
>     > Alternatively is there anyway to use git on the olpc itself,
>     does anyone
>     > have those instructions?
>
>     As root, 'yum install git-core' should do it.
>
>     > are preloading an array of 26 images ~32K each and this crashes
>     on the
>     > olpc.
>
>     Please provide more details. Memory allocation shouldn't *crash* the
>     machine under any (reasonable set of) circumstances; the OOM killer
>     might kick in and destroy a few processes, however. In your case,
>     you're
>     allocating less than a meg, so something is certainly wrong if it's
>     crashing. What kind of crash are you getting? Can you post the
>     code and
>     the images somewhere where we can test this?
>
>     --
>     Ivan Krstić < krstic at solarsail.hcs.harvard.edu
>     <mailto:krstic at solarsail.hcs.harvard.edu>> | GPG: 0x147C722D
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Sugar mailing list
> Sugar at lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
>   


More information about the Sugar mailing list