Yes, whether you parent an instance or not, it still takes up same amount of memory. In fact, the memory gets occupied exactly when you call the Intance.new() function.
Changing parent is just the matter of changing single property in the created object. You could proove that obj.Parent = nil takes as much memory as obj.Parent = game.Workspace. If you think about roblox objects from C side, the Parent property is simply a pointer to other object, that should be the parent. If parent is nil, the pointer is set to the NULL pointer, which is same size as normal pointer.
To properly free the object from memory, you have to use the obj:Destroy() method. Roblox will try to garbage collect unused objects, but if you still have the object referenced somewhere in your code or hooked up to an event, it will stay there, taking up memory. This is how the obj:Remove() method works and the reason you shouldn't use it anymore. Destroying object will lock the object and disconnect all event listeners connected to it.
The only thing that setting object's parent to nil could affect, is the render performance, but there would be no real difference from setting the part parent to nil or hiding it in ReplicatedStorage. And after all, roblox is highly optimized, so you wouldn't see any performance difference from one part set to nil.
6 comments
Quick follow up question because thoughout the time of thinking about this question I've become less confident on my initial claim. Is "Instance.new("Part") the same as whitespace, as it does not define it to a variable?
I would say no, even if it isn't stored, it will be allocated for some period of time. But the garbage collector would quickly get rid of it, and replace it with other object.
Okay. Thanks for the insight.
It would be easy to proove, since if you add 2. argument to that call, you would see part get parented without problems. This is what I mean: Instance.new( "Part", game.Workspace )
:Destroy()will not free the memory immediately -- if there are still references to it, it will not be freed. All the properties on a :Destroy()ed object are still available, and thus it cannot necessarily be GC'd.Folllowing up on this, making 5000 of those Parts with a nil parent and no holding reference would mean nothing by the time that you yield anywhere because the GC will clean up the new Instances. It will cause a small performance hit however, so take this in mind.