User Tag List

Results 1 to 5 of 5

Thread: Ways of limiting memory consumtion?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    Sweden
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ways of limiting memory consumtion?

    Hi

    Experimenting with a image viewer application using the Active Picture object to draw small 128xXXX pictures for every image in a folder (using the "zoom to rectangle" function).

    The problem - the memory consumtion goes throught the roof.
    I am talking about really big JPEG files here, so they are really big if you use them fullsize.

    I realise that Active Picture loads them as fullsize and only does a scaling of them, thus leaving the big image in memory. It seams that it does this whatever way of scaling I tell it to use. In my exemple, this is quite unecessary since the fullsize image is not going to be used - can you unload the fullsize image in some way so that Active Picture only use the zoomed out picture that it has created (the 128x128 picture)? That would reduce the memory usage...

    I tried an approach where I used the image manipulator object to create a small picture for every image in the directory. The problem with this approach is of course that you either have to save all these small pictures in the same directory as the originals or in some image cache directory that you create for your application.

    Have I overlooked some easy solution?
    /Best regards
    Mathias

    PS. Can you easily draw a fram around the Active picture object?

    PPS. Is there any way to tell the debugger for MMF2 to appear on some other space than upper left corner? I have my task bar there..

  2. #2
    Clicker Multimedia Fusion 2 Developer
    Matt's Avatar
    Join Date
    Jun 2006
    Location
    Connecticut
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Ways of limiting memory consumtion?

    Windows Explorer uses caching (it can be disabled, though), so it wouldn't be that horrible a thing to do. View a directory in Thumbnails mode and then check out Thumbs.db (it's the hidden cache file).

    On another note, MMF is very poor when it comes to object interoperability. You'd like to be able to take an image from Image Manipulator and send it to the Active Picture, but because the objects don't like to play together, you have to send the file to disk to do it. Perhaps someday, MMF will have some nice mechanisms for object interoperability.

  3. #3
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Ways of limiting memory consumtion?

    Yeah that is one of the flaws with the system right now. Once I voted for additional data types for MMF (imagine sending an image to an object through an expression.

    Matt made the first steps for object interoperability like that by allowing objects to read the image from the overlay object (Alphachannel Object and Active Overlay for example) by providing users with an an expression to get the memory address to the object and therefore also the image. This is extremely useful and extension writers should really think about adding such features to their objects.

    On my own 'todo' list I have planned an Image() expression for the Lens object so other objects can use the output of it, a memory adress to the board in Advanced Game Board object so other extension writers can program their own little addons to the object. For example an easy sudoku solver, tetris, connect the pipe-game helpers or something like that.

    Another extension idea I had today was an image thumbnailer extension. You will notivce how efficient and fast some programs are at loading hundreds of large JPG files' thumbnails without much delay. I think it just reads some of the jpg file and forgets the rest because it knows they whon't be needed any larger. MMF and MMF2's active picture object has to load the entire picture and keep it that way in memory in case the user wanted to resize it. I think a specialized extension for thumbnailing would be required.

    Spyfrog:
    Haven't tried this, but can't you load the image, shrink it, add it as a backdrop object and then delete the image? It requires some more coding but would maybe fix your problem.

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Location
    Ohio, United States
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Ways of limiting memory consumtion?

    I found this out when I was using MMF 1.5 to make a tile engine. In my engine, loading a level would take up over 100 MB of memory, which is quite a waste of resources. I think it should put each loaded image into memory only _once_. Otherwise it just wastes memory.

    I was looking for alternatives. No other extension could both load external images and add backdrops. The closest I got was Text Blitter. That extension claims that it does everything that an Active Object can, but doesn't let you add a backdrop. How pathetic!

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    Sweden
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Ways of limiting memory consumtion?

    Thanks for your input, both Andos and Matt, but I need to be able to change order of the pictures with drag and drop, so it needs to be an active object within MMF.

    My idea is to make a simple image viewer/image display program. The one already included in Windows XP is good but can't reorder the images in the way you like (you have to name them so they appear in right order).

Similar Threads

  1. Limiting an Angle
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 1st May 2013, 09:37 AM
  2. Memory Object - Additional Memory Types
    By Cudmuffin in forum Extension Development
    Replies: 0
    Last Post: 22nd November 2011, 11:43 AM
  3. limiting events
    By willow in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 27th February 2010, 09:22 AM
  4. Limiting digits
    By MechatheSlag in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 27th February 2009, 06:20 AM
  5. Limiting Jumps
    By dsilvers in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 3rd February 2009, 02:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •