Changeset 44:348a0e8e4fd5
- Timestamp:
- 07/21/08 20:54:23 (4 months ago)
- Author:
- Ryan Daum <ryan.daum@…>
- Branch:
- default
- Message:
-
Application of patch to ceiling/size settings from christopher.cheetham@…
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r14
|
r44
|
|
| 38 | 38 | options.addOption("c", "ceiling", true, "ceiling memory to use in MB"); |
| 39 | 39 | options.addOption("l", "listen", true, "Address to listen on"); |
| | 40 | options.addOption("s", "size", true, "max items"); |
| 40 | 41 | options.addOption("V", false, "Show version number"); |
| 41 | 42 | options.addOption("v", false, "verbose (show commands)"); |
| … |
… |
|
| 109 | 110 | long maxBytes; |
| 110 | 111 | if (cmdline.hasOption("m")) { |
| 111 | | maxBytes = Integer.parseInt(cmdline.getOptionValue("m")) * 1024000; |
| | 112 | maxBytes = Long.parseLong(cmdline.getOptionValue("m")) * 1024000; |
| 112 | 113 | System.out.println("Setting max memory size to " + String.valueOf(maxBytes) + " bytes"); |
| 113 | 114 | } else if (cmdline.hasOption("memory")) { |
| 114 | | maxBytes = Integer.parseInt(cmdline.getOptionValue("memory")) * 1024000; |
| | 115 | maxBytes = Long.parseLong(cmdline.getOptionValue("memory")) * 1024000; |
| 115 | 116 | System.out.println("Setting max memory size to " + String.valueOf(maxBytes) + " bytes"); |
| 116 | 117 | } else { |
| … |
… |
|
| 126 | 127 | // create daemon and start it |
| 127 | 128 | MemCacheDaemon daemon = new MemCacheDaemon(); |
| 128 | | LRUCacheStorageDelegate cacheStorage = new LRUCacheStorageDelegate(max_size, maxBytes, 1024000); |
| | 129 | LRUCacheStorageDelegate cacheStorage = new LRUCacheStorageDelegate(max_size, maxBytes, ceiling); |
| 129 | 130 | daemon.setCache(new Cache(cacheStorage)); |
| 130 | 131 | daemon.setAddr(addr); |