actually, the file would be split into 2 parts : the first one would be the 
infos that i want the user to be able to modify (a couple of lines), the 
second one would be a text of n lines (n being a number of vertices for a 
mesh, for instance), that the user will definetly not modify. So you're 
right, maybe i should split it into 2 files, the first in json or similar, 
the second encoded..
For the memory leak, yes, i did experience something similar, during my 
last project (yes, in rigging too, it was nothing but fun on this project 
=p ), but with in-house tools. So i've seen it, but didn't do it myself. 
But that's why i'm concerned about that. And by memory leak, i'm also 
talking about memory management. For instance, you work on super heavy sets 
(like really super heavy sets.... ;-), and you want to load some datas 
attached to this set. By default, you'll have to load the entire data file, 
which will result in a huge consommation of RAM, and ultimately, probably a 
crash because of a lack of memory. So it wouldn't be a memory leak so to 
speak, but something that you'd have to handle by reading your file chunk 
after chunk, and flush the memory after each iteration. I'm not sure any 
module would do that automatically, though.
I'll think at my problem differently, and try to split it into 2 parts, 
that seems so obvious now you mentionned it ! Thanks !


Le jeudi 6 octobre 2016 10:29:18 UTC+2, Marcus Ottosson a écrit :
>
> cPickle looks great
>
> If you want it to be human readable, you can’t encrypt, compress or 
> otherwise obfuscate it, so both pickling and zlib is out. But think about 
> that for a second. If you are talking about multi-megabyte/gigabytes worth 
> of data, the mere quantity would make it uneditable regardless of the 
> format.
>
> The part that i’m not sure of is the memory management when working with 
> huge chunks of data, and i’m even not comfortable at how to mesure and 
> control it.
>
> I’m not sure why you would worry about that, unless you’ve experienced 
> some issues already? So long as you read the file into a variable, and that 
> variable isn’t kept around globally, then garbage collection would handle 
> this for you no matter which format you choose.
>
> To get a memory leak, you’d really have to try.
>
> import json
>
> leak = list()
> def read_file(fname):
>   with open(fname) as f:
>     data = json.load(f)
>     leak.append(data)  # builds up over time
>
> ​
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/211afd52-15e9-4b4f-81bb-05d11fb702b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to