• Content count

  • Joined

  • Last visited

Community Reputation

235 Neutral

About myvraccount

  • Rank
  1. Problem with PagedMemorySize64

    But the attacker will not have physical access, unless you're expecting a criminal to break in. I mean seriously, if the attacker has physical access then practicallly ANYTHING could happen! I'm trying to prevent attacks through the Internet. They can't arbitrarily read any data anywhere in ram through the Internet, can they? And the reason I don't want stuff stored on the hard drive has more to do with what happens when the computer eventually gets thrown away and someone digs through the trash.
  2. Problem with PagedMemorySize64

    Well thanks then GibbonThatCodes. At least that tells me that I must be using the wrong function for what I'm trying to do, but I guess I'll still have to post to Stack Overflow or something to figure out which function I should use.
  3. Problem with PagedMemorySize64

    OK sorry, but you don't have to close my threads like you just did with the other one. I mean if you don't want to answer my question that's your business, but when you close it you prevent anyone else from possibly being able to answer it, even if they would have! Oh, and also, if the "General Programming" must be about games then why is it called "General Programming"?
  4. Problem with PagedMemorySize64

    OK then I guess like the other one, it should go in the General Programming forum. That's "General" enough for it, right? And how do you know it's not relevant for games anyway? People save games in files all the time. I'm really not trying to be snide, but just making a point.
  5. Running out of memory prematurely

    OK, sorry. I wasn't sure where it belonged because it seems like a relatively simple problem and people used to keep telling me that the things I post should be moved to beginners. So for future reference, what kinds of things are intended for the beginners forum? I don't know why everyone ALWAYS expects me to post code. Yes, I understand that in many cases it can be more convenient, but doesn't anyone else understand the concept of confidentiality? I narrowed the problem down to a specific line. I KNOW for certain that nothing else is causing it either directly or indirectly, because as I said, the stream works for all but the largest files. And all the line does it write data from an already existing array into a file. So here's the line, or something so similar that you wouldn't be able to tell the difference: fs.WriteByte(bytes); fs is a file stream, bytes is an array of bytes, and i is the index of a for loop. Happy now? And the exception is called OutOfMemoryException. I thought that was a common enough one that pretty much anyone would recognize it.
  6. Sometimes I get an out of memory exception when I don't think I should. It's been happening when I try to write a file to the hard drive. For analytical purposes I have to have all the data loaded into ram before writing it, and it is several dozen megabytes. However, I know that I have 16 gigabytes of ram and I'm hardly running any other programs, certainly not anything that would take a significant fraction of it. Isn't memory first-come first-serve, meaning that Windows should let me have however much I need until I've used it all and then run out? Also, it oddly occurs while I'm writing the file. The data is already in ram, and I'm not allocating any more. I thought that the only thing that could cause that exception was a memory allocation, or am I wrong? And by the way, I know that the stream and everything is working, because if I use smaller files with the same function, it works fine. The problem only happens when I use a huge file, and it tends to happen late in the process when it's near the end of writing the file.
  7. I'm using C#, and trying to figure out how much memory a process is using within the paging file or how much of its memory within physical RAM can be moved to the paging file if necessary. Unless I'm mistaken (and I might be), the function PagedMemorySize64 is supposed to tell me how much is currently in the paging file, and PagedSystemMemorySize64 should tell me how much is in RAM but could be moved into the paging file at any time. If those assumptions are correct, then so far so good. However, even when "No paging file" is checked within my Virtual Memory properties window, these two functions both return positive numbers! Why would that be? Also, I opened the "Performance" tab on the Windows Task Manager, and in the section called "Kernel Memory (MB)" it says that "Paged" is a positive number (a pretty small number like in the hundreds, but I don't know if it's counting pages or bytes or what). Am I imagining things, or is my computer actually using a paging file even when I tell it not to, or alternatively, do those paged memory size 64 functions not work or just not do what I think they do?
  8. Virtual Memory

    Let me put it this way. I trust the user's intentions, but not necessarily their ability to follow directions when it comes to technical issues, so I'd rather have those things automated. I don't see how disabling the paging will make programs run slower. Frankly, if everything ran just in RAM, it would be a lot quicker. And you can get a ton of RAM cheaply these days, so to me paging seems sort of antiquated anyway, unless you're going to run programs that have HUGE amounts of data. And this isn't for general-purpose software. It's for software that I'm developing for specific people, not to distribute to the general population, if that's what you're implying.
  9. Virtual Memory

    I might typically agree if I didn't want to send information to said user and make sure that it is kept secure. And I don't see how it would be at anyone's "expense" if I'm implementing the security into the software.
  10. Virtual Memory

    Well if someone wanted to do that remotely, it would be spyware, and at least there's anti-spyware available. However, while something's in RAM, it only exists until the computer is restarted, but once something's on a hard drive, even if it's deleted it can still be found later, even if you need certain forensic tools to search the hard drive. Touche.
  11. Virtual Memory

    jpetrie, thanks for the info. It's enlightening. I was under the impression that what you're referring to a virtual memory, in terms of address re-mapping, was actually called protected mode addressing (at least that's what they called it when I studied assembly language for 68000 processors), but supposedly there are "rings" on PC, and the lower ones use that. I don't know. Anyway, the reason I do not want the program running if virtual memory (or demand paging, or whatever it's really called) is enabled (or is greater than 0 bytes for maximum size), is because it's a huge security flaw! If a program encrypts anything before saving, then un-encrypted data will never exist on the hard drive, but if this mechanism can arbitrarily save anything in RAM onto the hard drive, that's very dangerous! Also, I'm inclined to believe that there must be some way to do it, because after all, Windows keeps track of that information, so it must be stored somewhere right?
  12. Virtual Memory

    Correct me if I'm wrong (and I may well be) but the function in the first link actually seems to tell me how much virtual memory the program/process is actually using. I only want to know the total size the the entire swap file or whatever you want to call it. As in, how much is allocated for the whole computer to be allowed to use at maximum. But the way you described it, it seems like that's what the second link is doing? Did you accidentally say it backwards? And as for the structure mentioned in the second link, I looked up the ullTotalPageFile, which seems like it should be for the whole system, but according to a link I followed from there, it seems to be for just the current process, so maybe that's an accurate description after all. In any case, the only thing I need is the whole maximum amount set for virtual memory for the whole system (the "Maximum size (MB)" in the virtual memory properties window). So whatever way I can get that would be great! I prefer not to have to use a DLL but I will if I must. Thanks a lot. And the number needs to exclude the size of RAM.
  13. Virtual Memory

    I couldn't edit any more for some reason because I guess they imposed a stupid space limitation. Anyway, come to think of it, then how did the game know whether I had virtual memory enabled or not?
  14. Virtual Memory

    Can't I? Then what's this option called "No paging file"? Anyway, the reason I want to check for this is because I want my program to only run if virtual memory is disabled (or I guess if the paging file is 0 bytes), otherwise it will give an error and exit.
  15. Virtual Memory

    I'm using C#, and trying to test whether Windows has virtual memory enabled or not. I just need a function that can return a bool for this. Does anyone know of one? I know it's possible because I remember trying to play a game once and getting an error that said I needed to enable virtual memory.