Trying to put a file into virtual memory many times
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Trying to put a file into virtual memory many times
Hello,
So this will sound as if there is no purpose to this post, but actually I do need it done for a specific purpose that I have with the file. Thank you.
Ok, so basically what I need to do is to take a single image file on the computer and memory map the file into the virtual memory space. But I don't want to do this just once, I need to fill up my entire hard drive disk's virtual memory space.
The programs that I have found to do this will only put one file into virtual memory at a time. I need to put 20,000 of the same image file into virtual memory.
I have been trying for a while now to do this and saw that this forum has heavy traffic and hoped someone might know how this could be done. Thank you for any help!!
Also want to note that I did find this exact question posted here already, but then someone said why do you need this, and they realized that they needed to put the files onto another computer. This is putting a file on one computer into the same computer's virtual memory space.
Hello,
So this will sound as if there is no purpose to this post, but actually I do need it done for a specific purpose that I have with the file. Thank you.
Ok, so basically what I need to do is to take a single image file on the computer and memory map the file into the virtual memory space.
A memory mapped file will share the buffers. In fact, ANY duplicate file usage will share the buffers.
Quote:
But I don't want to do this just once, I need to fill up my entire hard drive disk's virtual memory space.
Hard drives don't have virtual space. To get even something resembling that you have to use compression.
Quote:
The programs that I have found to do this will only put one file into virtual memory at a time. I need to put 20,000 of the same image file into virtual memory.
The only way to do that is to run the same program multiple times. Each individual process will read the file into private memory thus you get separate copies.
NOTE: It is possible that the memory gets deduplicated. Besides saving memory, it also reduces page faults. And using a memory mapped file just page faults from the file - and minimizes the unnecessary wasted useage of memory.
Quote:
I have been trying for a while now to do this and saw that this forum has heavy traffic and hoped someone might know how this could be done. Thank you for any help!!
You still need to say why you need to do something that is inherently wasteful of resources.
Basically, I don't want to confuse anyone, so this technology is similar to brainwave entrainment, which uses sounds to change your mind. Just google brainwave entrainment. This new technology gets more powerful the more times the file is in use, and since putting a file into virtual memory is technically being used by the computer, the more powerful it is to change your mind.
Yes, I have also tried writing up a simple Java program that memory maps an image file, and then repeats til the space is ful. However, I believe it is only putting the file into virtual memory every second. I need to put 20000 files into the virtual memory space instantly.
Another idea I have is to do this using ftp. I've read it's possible to put files into the virtual memory space with ftp, but not sure how to do this over and over again instantly.
Basically, I don't want to confuse anyone, so this technology is similar to brainwave entrainment, which uses sounds to change your mind. Just google brainwave entrainment. This new technology gets more powerful the more times the file is in use, and since putting a file into virtual memory is technically being used by the computer, the more powerful it is to change your mind.
Yes, I have also tried writing up a simple Java program that memory maps an image file, and then repeats til the space is ful. However, I believe it is only putting the file into virtual memory every second. I need to put 20000 files into the virtual memory space instantly.
That is what the "virtual" in "virtual memory" means.
Quote:
Another idea I have is to do this using ftp. I've read it's possible to put files into the virtual memory space with ftp, but not sure how to do this over and over again instantly.
The ONLY way to do it is use a ramfs mount... And copy the file into multiple names on that tmpfs mount.
But doing so is just a waste of time and memory. It has NOTHING to do with brainwave entrainment.
Ok, so basically what I need to do is to take a single image file on the computer and memory map the file into the virtual memory space. But I don't want to do this just once, I need to fill up my entire hard drive disk's virtual memory space.
Trouble is, "the operating system is too smart for that." It knows that you have mapped the same file. Therefore, it will draw data for each mapping from the same file.
Furthermore, the contents of "a memory-mapped file" always only come from ... the mapped file. It is never "copied into" virtual memory and never consumes backing store.
Further-more, Linux will not allow you to consume all of the physical swap resource. (That would be a denial-of-service attack upon the system.)
Trouble is, "the operating system is too smart for that." It knows that you have mapped the same file. Therefore, it will draw data for each mapping from the same file.
Furthermore, the contents of "a memory-mapped file" always only come from ... the mapped file. It is never "copied into" virtual memory and never consumes backing store.
Further-more, Linux will not allow you to consume all of the physical swap resource. (That would be a denial-of-service attack upon the system.)
As long as the file is in the virtual memory of the computer, it does not matter where data is drawn from. Well, it doesn't need to be 'copied into' virtual memory as long as that same file fills up the virtual memory space.
As for filling up the virtual memory space of the computer, I already have a program that does all of this on Windows, so maybe I just need it to fill up 99% of the virtual memory space because I know it can be done with no errors.
That is what the "virtual" in "virtual memory" means.
The ONLY way to do it is use a ramfs mount... And copy the file into multiple names on that tmpfs mount.
But doing so is just a waste of time and memory. It has NOTHING to do with brainwave entrainment.
Actually this technology is different than brainwave entrainment, but the exact same concept. This new technology, you don't need to listen to anything. You just need to have a computer with the image file in the virtual memory space or opened with ram to feel the effects.
Thank you for the ramfs suggestion with tmpfs I am going to have to try this way.
Actually this technology is different than brainwave entrainment, but the exact same concept.
Not even close. brainwave entrainment involves unconscious information exchange. You aren't exchanging information with anything by having the memory of a computer loaded with arbitrary information (or even random data for that matter).
Quote:
This new technology, you don't need to listen to anything. You just need to have a computer with the image file in the virtual memory space or opened with ram to feel the effects.
"feel the effects"? not a chance. The only time you can have an effect from an image is by LOOKING at the image. And then it will only be the size of the display. 1920x1080 is a fair number of pixels, but very likely the "image" is only an "image" in the video hardware. Just being in the memory of the computer will do nothing.
Quote:
Thank you for the ramfs suggestion with tmpfs I am going to have to try this way.
tmpfs will use swap, which is why I suggested using ramfs. All you will do with tmpfs is fill swap. Not the "virtual memory". Ramfs will allocate a specified amount of physical memory - which can then be used as a file store.
This technology works, you can trust me... If you think that something is impossible then you just don't have an open mind dude . Well I'm not trying to be harsh it's just that I know it works, and I need it done so I tried to get it done by myself and it didn't so I am now asking for help...
Last edited by Thirdeyematt; 08-31-2016 at 05:28 PM.
Reason: None
This technology works, you can trust me... If you think that something is impossible then you just don't have an open mind dude . Well I'm not trying to be harsh it's just that I know it works, and I need it done so I tried to get it done by myself and it didn't so I am now asking for help...
Not really. I just know that trying to use telepathy between a computer and a person doesn't work.
virtual memory (swap) is actually a partiton, some space on the hard drive. Nothing else. Keeping files/images/music whatever on disks has no any effect on human beings (not speaking about the event when the disk is destroyed and your valuable data will be vanished).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.