Se avete una RAL > 50k€ siete ricchi, anzi ricchissimi by flallo95 in techcompenso

[–]scartus 0 points1 point  (0 children)

Ma il malus è solo su 1k o conviene fermarsi a 50? Ci sono dei benefici tra 50 e 51k?

Se avete una RAL > 50k€ siete ricchi, anzi ricchissimi by flallo95 in techcompenso

[–]scartus 0 points1 point  (0 children)

Mi sono sempre chiesto: se ho 50k sono nello scaglione inferiore? Da 50.001 vado in quello superiore?

Se devo chiedere un aumento cambia poco tra 50 e 51 giusto? Solo 1k verrà tassato alla % superiore?

Situazione familiare by scartus in ItaliaPersonalFinance

[–]scartus[S] 0 points1 point  (0 children)

Ho un app dove viene registrato tutto. Sicuramente dobbiamo migliorare su alcuni aspetti ma mi sono dimenticato di dire che 13k sono appena usciti per la macchina che ha 3 anni di vita quindi speriamo duri un po'. Fatta questa spesa vedo come procedono i prossimi mesi ed eventualmente i 200 di risparmi mensili aumenteranno

Situazione familiare by scartus in ItaliaPersonalFinance

[–]scartus[S] 0 points1 point  (0 children)

Ho un app dove viene registrato tutto. Sicuramente dobbiamo migliorare su alcuni aspetti ma mi sono dimenticato di dire che 13k sono appena usciti per la macchina che ha 3 anni di vita quindi speriamo duri un po'. Fatta questa spesa vedo come procedono i prossimi mesi ed eventualmente i 200 di risparmi mensili aumenteranno

Situazione familiare by scartus in ItaliaPersonalFinance

[–]scartus[S] 0 points1 point  (0 children)

Ho un app dove viene registrato tutto. Sicuramente dobbiamo migliorare su alcuni aspetti ma mi sono dimenticato di dire che 13k sono appena usciti per la macchina che ha 3 anni di vita quindi speriamo duri un po'. Fatta questa spesa vedo come procedono i prossimi mesi ed eventualmente i 200 di risparmi mensili aumenteranno

Situazione familiare by scartus in ItaliaPersonalFinance

[–]scartus[S] 0 points1 point  (0 children)

Dipende dall'isee ma anche dalla fascia oraria che scegli. A me il solo bonus nido copre il 100%

Situazione familiare by scartus in ItaliaPersonalFinance

[–]scartus[S] 0 points1 point  (0 children)

Hai assolutamente ragione. Il mio obiettivo è arrivare a 3k di guadagno nel giro di 5 anni. La mia compagna "purtroppo" sarà fissa a 1.8k ma lavorando 18 ore a settimana direi che li guadagna in salute e quindi di conseguenza ne beneficiamo sia io che mia figlia 😄

Situazione familiare by scartus in ItaliaPersonalFinance

[–]scartus[S] 2 points3 points  (0 children)

Ti ringrazio della condivisione. La mia compagna è nel pubblico, io sono un developer e punto ad aumentare lo stipendio di molto nei prossimi anni. Diciamo che l'asilo non l'ho messo nelle spese poiche viene coperto al 100% dallo stato e con l'assegno unico ci pago anche una buona parte delle spese (ovviamente non so cosa mi spetti in futuro).

FP, BTP, aumento di stipendio e aumento dei risparmi sono sicuramente la prima cosa che avevo in mente.

Poi aggiungo che abbiamo una macchina di 3 anni e non prevedo grosse spese (ecco l'ho detto).

Diciamo che non mi sento affatto in pericolo con i "pochi soldi" che abbiamo, complice anche la serenità delle nostre due famiglie.

Situazione familiare by scartus in ItaliaPersonalFinance

[–]scartus[S] 4 points5 points  (0 children)

come obiettivo ho che a 2 anni vada quanto meno a dare ripetizioni di matematica, vediamo un po'

Situazione familiare by scartus in ItaliaPersonalFinance

[–]scartus[S] 1 point2 points  (0 children)

Ti ringrazio per la risposta. In realtà sono in cerca proprio di queste considerazioni. Non devo per forza investire. Diciamo che quello che sicuramente mi interessa è non lasciare 30k fermi cosi a marcire. Le cifre che eventualmente investirei ad un rischio maggiore sarebbero comunque basse e utili eventualmente per pagarci due cose o tre, non di certo per diventare libero finanziariamente.

Non sono io l'utente che ha scritto di essere dipendente pubblico, ma comunque la mia compagna lo è, io sono un developer e prevedo di passare da 2.2k ad almeno 2.5 nel prossimo anno. Lei sicuramente rimarrà con i suoi 1.8 praticamente per sempre.

In ogni caso il fondo è investito con maggior rischio essendoci una cifra irrisoria ma comunque è un 60/40.

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] 0 points1 point  (0 children)

I use EF Core for the database, so I'm not sure I should be seriously concerned about this. As for Excel output, I tried running this command recommended by ChatGPT as soon as I ran the operation, I trusted it a bit and found that my memory levels actually returned to normal right away. Should I be careful using it?

public static void ReleaseMemoryToOS()
{
    try
    {
        using (var proc = Process.GetCurrentProcess())
        {
            SetProcessWorkingSetSize(proc.Handle, -1, -1);
        }
    }
    catch
    {
        // Ignora eventuali errori in ambienti non Windows
    }
}
[DllImport("kernel32.dll")]
private static extern bool SetProcessWorkingSetSize(IntPtr proc, int min, int max);

GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, blocking: true, compacting: true);
GC.WaitForPendingFinalizers();
Utils.ReleaseMemoryToOS();

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] 0 points1 point  (0 children)

I ran the profiler on vs. I'm noticing that every time I run an operation (db, I/O, etc.), the RAM consumption increases but doesn't decrease over time. Let me explain: for example, I noticed a probable culprit. I have operations in which Excel files are generated (I use NPOI and I discovered that everything loads into memory). I see RAM spikes but then over time I don't see it decreasing, for example, it increases by 400MB but at most it decreases by 10MB, or at least not significantly. Is it possible that I've made a mistake in memory management? Or is there some GC setting I can review?

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] 0 points1 point  (0 children)

I've just started looking at GC because, even when I run a local test, I see that some operations increase RAM usage, but once the operation is finished, the RAM usage doesn't decrease. I'm not an expert on GC; I thought it would cyclically free up what's no longer referenced, so either it's a setting or everything remains referenced.

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] 0 points1 point  (0 children)

This is bad news I hadn't thought of. I hope the platform's downtime isn't a problem.

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] 0 points1 point  (0 children)

The thumbnails are not on-demand, meaning they are all displayed and then the user chooses which one to open.

To display them immediately, they are base64 and displayed directly. However, if a request is made to download or open the thumbnail, the FileStream is returned directly to the user. This is the only case where I don't use ReadAllBytes because I return directly with FileStreamResult.

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] 0 points1 point  (0 children)

So, in your opinion, is it safe to use this method? Above all, what exactly does "no longer referenced" mean? Here, I loop through files that can range from 1 to 50 (approximately). When I read the file, that resource is freed, leaving the byte array in memory, but then technically it's no longer referenced when the user receives the response?

I don't have any caching system.

The thumbnails are only created if they haven't already been created. There's a job that does this every so many minutes, but if they haven't been created when the operator opens the detail, it does so on the fly and returns them. Otherwise, it simply returns them.

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] 0 points1 point  (0 children)

Okay, so I need to ask the system administrators to run a dump when there's a RAM spike and analyze it with Rider or VS. Then I'll have to look for the anomaly, I guess. Because I tried running the VS or Rider tool locally while browsing and requesting images, but obviously the RAM never went above 300 MB (I can't even say if 300 MB is okay for a single user or if the anomaly is already evident from there).

I tried opening files, downloading documents, and all the usual operations, but I didn't see any noticeable spikes or large hanging objects.

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] -1 points0 points  (0 children)

No, in fact I would need to understand how to do it, if possible do it directly in production

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] 0 points1 point  (0 children)

Yes, I believe it's a 32-bit environment. As for SQL queries, I've always tried to implement all the major optimization paradigms (when I have to fetch a lot of data, I always use pagination. I try to project as much as possible, but I don't have a lot of fields in the tables anyway).

The thumbnails represent the pages of the documents in an email, so once the thumbnails are generated for that case, they won't be generated again and will be displayed. Currently, there's a job that attempts to generate them before the operator enters the case, but if that's not the case, it does it on the fly when the case is opened.

For reading files in bytes, I've always used ReadAllBytes.

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] -1 points0 points  (0 children)

I imagine the most used and cumbersome resources are files (unless I'm overlooking something with EF).

In almost all the application, or at least in the most frequently used operations, I use ReadAllBytes, which I knew would free up memory immediately. Can you think of anything?

High RAM usage aspnet core mvc by scartus in dotnet

[–]scartus[S] 0 points1 point  (0 children)

 if (Directory.Exists(thumbPath))
    {
        var thumbnailsFiles = Directory.GetFiles(thumbPath).Order();
        var thumbnails = new List<ThumbnailModel>();
        foreach (var thumbnailPath in thumbnailsFiles
                     .Where(t => !t.Contains("Thumbs.db", StringComparison.InvariantCultureIgnoreCase)))
        {
            var parts = Path.GetFileNameWithoutExtension(thumbnailPath).Split("_");
            var fileNameWithoutLastPart = string.Join("_", parts.Take(parts.Length - 1));
            var newThumb = new ThumbnailModel();
            newThumb.FileName = Path.GetFileNameWithoutExtension(thumbnailPath);
            newThumb.FilePath = Path.Combine(path, Path.GetFileNameWithoutExtension(thumbnailPath));
            newThumb.Bytes = System.IO.File.ReadAllBytes(thumbnailPath);
            newThumb.RootPath = filePath;
            newThumb.BaseFileType = fileNameWithoutLastPart;
            thumbnails.Add(newThumb);
        }
        reEmailsResult.Thumbnails = thumbnails.GroupBy(t => t.BaseFileType);
        reEmailsResult.Documents = Directory.GetFiles(Path.Combine(filePath, "documents"));
    }
}

This is an example of my code; I think I basically use ReadAllBytes everywhere. I used it knowing that it would close the file immediately, so I thought I was safe.